Interrupt (pause) running Python program in pdb?

No, python2’s pdb doesn’t support this, but you add this code to your program as a workaround:

def debug_signal_handler(signal, frame):
    import pdb
    pdb.set_trace()
import signal
signal.signal(signal.SIGINT, debug_signal_handler)

Related questions:

  • Showing the stack trace from a running Python application
  • enter pdb with kill signal

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)