Last active
February 4, 2021 21:03
-
-
Save ConnorNelson/c70d5518302b2679e10f8fc61f43112c to your computer and use it in GitHub Desktop.
Remote Python Debugging
This file contains 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
if __name__ == "__main__": | |
try: | |
main() | |
except Exception as e: | |
import sys, os, traceback | |
traceback.print_exc() | |
os.system("pip install remote-pdb") | |
import remote_pdb | |
print("Run `rlwrap socat - tcp:127.0.0.1:4321`", file=sys.stderr, flush=True) | |
p = remote_pdb.RemotePdb(host="0.0.0.0", port=4321) | |
p.reset() | |
p.interaction(None, sys.exc_info()[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment