-
-
Notifications
You must be signed in to change notification settings - Fork 33
Looking at variables in functions (or other local scopes)
Almenon edited this page Aug 25, 2018
·
1 revision
If you want to dump local variables or dump variables at a specific point in your program you can use the dump function:
from arepldump import dump
def milesToKilometers(miles):
kilometers = miles*1.60934
dump() # dumps all the vars in your function
# or dump when function is called for a second time
dump(None,1)
milesToKilometers(2*2)
milesToKilometers(3*3)
for char in ['a','b','c']:
dump(char,2) # dump a var at a specific iteration
a=1
dump(a) # dump specific vars at any point in your program
a=2