Created
April 24, 2012 20:34
-
-
Save duckworthd/2483503 to your computer and use it in GitHub Desktop.
Instant Debug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A module that allows one to press CTRL+\ at any time to pause program execution. | |
The stack may be examined with `u` and `d`, and the process can be continued with | |
`c`. For example, | |
import instant_debug | |
import time | |
for i in xrange(10000): | |
print i | |
time.sleep(0.1) | |
''' | |
import signal | |
import ipdb | |
def handler(signum, frame): | |
ipdb.set_trace() | |
signal.signal(signal.SIGQUIT, handler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment