Created
February 6, 2019 01:30
-
-
Save cauethenorio/8d6a01ef591d6743252b4354569c1973 to your computer and use it in GitHub Desktop.
Python script template with debugger
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
#!/usr/bin/env python | |
# https://news.ycombinator.com/item?id=19078825 | |
import traceback | |
import pdb | |
import sys | |
def main(): | |
# some WIP code that maybe raises an exception | |
return 0 | |
if __name__ == "__main__": | |
try: | |
ret = main() | |
except: | |
traceback.print_exc() | |
pdb.post_mortem() | |
sys.exit(ret) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment