Way to debug exec()?

15 views
Skip to first unread message

NerdFever.com

unread,
Jul 26, 2022, 2:23:37 PM7/26/22
to spyder
I have a program that loads some source code like this:

exec(open("foobar.py").read())

Is there a way to debug execution of foobar.py?

(I'm doing this partly because "foobar.py' contains some passwords which I'm trying to keep separate from the rest of the source code.)


Carlos Córdoba

unread,
Jul 28, 2022, 11:38:24 AM7/28/22
to spyd...@googlegroups.com

Hi,

Perhaps that could be done by adding a breakpoint() call where you want to stop in foobar.py. When running exec that should enter the Spyder debugger, at least in theory.

Cheers,
Carlos

El 26/07/22 a las 13:23, NerdFever.com escribió:

--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/df162d62-6915-45e2-854b-6f7b016c9a3cn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages