0

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
I think the problem is that I can't find "python attach" in the debug window after starting the python script from the app

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.