Skip to content

Instantly share code, notes, and snippets.

@ReallyLiri
Created July 11, 2019 08:55
Show Gist options
  • Save ReallyLiri/a71e4ba2ff9465837ee918a2b2273401 to your computer and use it in GitHub Desktop.
Save ReallyLiri/a71e4ba2ff9465837ee918a2b2273401 to your computer and use it in GitHub Desktop.
Attach remote debugger to python code point
import sys
import os
import pydevd
import logging
def stop_on():
sys.path.append('/Applications/PyCharm.app/Contents/helpers/pydev/')
sys.path.append('/Applications/PyCharm.app/Contents/debug-eggs/')
try:
port = 6868
print("Waiting for process connection... (Start a \"Python Remote Debug\" run configuration in pycharm with the port {})".format(port))
logging.info("Waiting for process connection...")
pydevd.settrace("0.0.0.0", port=port, stdoutToServer=True, stderrToServer=True)
except SystemExit:
logging.exception("Failed to connect to remote debugger, punk")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment