Skip to content

Instantly share code, notes, and snippets.

@ConnorNelson
Last active February 4, 2021 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ConnorNelson/c70d5518302b2679e10f8fc61f43112c to your computer and use it in GitHub Desktop.
Save ConnorNelson/c70d5518302b2679e10f8fc61f43112c to your computer and use it in GitHub Desktop.
Remote Python Debugging
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