I have a large python script with several files, and I need to know where the method was called. Is there a backtrace function in python like debug_backtrace in php?
See traceback module .
import traceback def foo(): bar() def bar(): baz() def baz(): traceback.print_stack() # or trace = traceback.extract_stack() foo()
If you want to debug python
import pdb
then release
pdb.set_trace()
Where would you like to start debugging
see this site for more information
http://docs.python.org/library/pdb.html