Search code examples
pythonpython-2.7debuggingvisual-studio-2013ptvs

How to attach to running python script via PTVS at beginning of execution


I want to attach to a python script that is called by another program (.exe).

I am developing the python script.

Right now, I am using (Python 2.7)

raw_input("Press Enter to continue and/or attach debugger...")

to make the script wait and attach the debugger.

Is there some convenient way, like C#

Debugger.Break()

(see https://stackoverflow.com/a/105599/586754 ) to directly prompt me to attach with the already open Visual Studio instance? Manually attaching (especially when doing many runs) takes some time. I have done it so often I even know Ctrl+Alt+P to open the attach dialog (then click in program list, hit p for python, click attach..).


Solution

  • There is no such thing currently. Feel free to file a feature request.