1

Inputting 'w(here)' into the IPDB or RDB will print out a stack trace.

Is there a way to do this without entering set_trace()?

I guess what I'm imagining would be something like print(w), or otherwise simply printing the stacktrace at the point where I set_trace().

Jay Jung
  • 1,805
  • 3
  • 23
  • 46

1 Answers1

2

traceback.print_stack() is what you want, it will print current call stack start from sys._getframe(), see more on its doc.

georgexsh
  • 15,984
  • 2
  • 37
  • 62