Coding a breakpoint, which activates the REPL debugger:
import pdb
pdb.set_trace()
Printing out the stack trace of an exception:
import traceback
try:
print(variable_that_does_not_exist)
except Exception as e:
print(traceback.format_exc())
Coding a breakpoint, which activates the REPL debugger:
import pdb
pdb.set_trace()
Printing out the stack trace of an exception:
import traceback
try:
print(variable_that_does_not_exist)
except Exception as e:
print(traceback.format_exc())
import traceback try: print(variable_that_does_not_exist) except Exception as e: print(traceback.format_exc())
import traceback try: print(variable_that_does_not_exist) except Exception as e: print(traceback.format_exc())
import traceback try: print(variable_that_does_not_exist) except Exception as e: print(traceback.format_exc())
Comments
Post a Comment