How can I debug a python program from an external app?
I'm using guildAI which is an external utility, that when running guild run train.py internally it runs python train.py but with other wrappers.
Is there a way, to somehow debug (like remote debugging) with vs code such applications?
I.e tell vs code to run guild run train.py for me? or some other way
Add a comment
|
1 Answer
You want to do what's called "local attach". Basically what you need to do is install ptvsd with your app, call ptvsd.enable_attach() and ptvsd.wait_for_attach(), and then use breakpoint() to cause the debugger to pause upon attach to let you start walking through your app.
2 Comments
DsCpp
I didn't get that, nor vs code explanation.
guild isn't a python app, but it calls my train.py internally, and I don't have access to guild. Can I still attach a debugger to train.py?DsCpp
I think the problem is that I can't find "python attach" in the debug window after starting the python script from the app