Debug the values passed to a function in python
Tested on python 2.
import inspect
def caller_args():
frame = inspect.currentframe()
outer_frames = inspect.getouterframes(frame)
caller_frame = outer_frames[1][0]
return inspect.getargvalues(caller_frame)
def updateval(infile,regex,result,verbose=False,apply=False,debug=0,stanza="",stanzaregex="",atbeginning=False):
print caller_args()
It's that simple!
Comments