Skip to content

Instantly share code, notes, and snippets.

@jtomori
Created December 22, 2018 21:02
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 jtomori/f9c448ebce3ebc3bddca6bb288ee6983 to your computer and use it in GitHub Desktop.
Save jtomori/f9c448ebce3ebc3bddca6bb288ee6983 to your computer and use it in GitHub Desktop.
import ptvsd
# allow other computers to attach to ptvsd at this IP address and port, using the password
try:
ptvsd.enable_attach("SFds_KjLDFJ:LK", address = ('localhost', 3000))
print("Not attached already, attaching...")
except ptvsd.AttachAlreadyEnabledError:
print("Attached already, continuing...")
def test():
# pause the program until a remote debugger is attached
ptvsd.wait_for_attach()
# break at this line
ptvsd.break_into_debugger()
before = "before"
after = "after"
print(before)
print(after)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment