Created
July 11, 2019 08:55
-
-
Save ReallyLiri/a71e4ba2ff9465837ee918a2b2273401 to your computer and use it in GitHub Desktop.
Attach remote debugger to python code point
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
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