Become a pdb power-user
Ashwini Chaudhary
2177

Is there any way to edit the .py script while debugging? Like the VBA or C# debugger?

I have a script where reproducing the bug costs a lot of time, 10 minutes of downloading and analyzing before I get to where the bug can occur. There are also further bugs down in the execution path.

Ideally I could get all the bugs in one pass, if it were possible to actively edit the script while it is debugging. Currently, I have to spend 5 minutes to get to the state of interest.

Any solutions?

Currently, my workaround is to use fake data that I don’t have to load for so long (don’t like this as the problem is with the real data)
Using the pdb, play with current context and enter code as if I had written it to the file (save changes in notepad to add to .py script later)