7

After I interrupt execution in Python interpreter (using CTRL-BREAK in Windows), can I continue execution?

If not, is there any other way to interactively pause execution (so I can view variable values), and then continue?

I prefer not to use the debugger because it's much slower than normal execution.

max
  • 49,282
  • 56
  • 208
  • 355
  • Do you mean, pause execution of any running Python process, attach a debugger, monkey around, and then detach and let it continue? – Chris Nov 16 '10 at 19:57
  • Yes, precisely. I was hoping it could be done by running a Python program from the Python interactive shell, pressing CTRL-BREAK, and then doing some magic to continue. But any other way to achieve the same outcome would be great! – max Nov 16 '10 at 22:08

2 Answers2

2

I don't know if you mean pdb by debugger, but if you don't (and it might be helpful for others here), you can try:

Here's a nice tutorial btw:

icyrock.com
  • 27,952
  • 4
  • 66
  • 85
2

I found some useful links that kinda answer my question:

http://blog.devork.be/2009/07/how-to-bring-running-python-program.html

How do I attach a remote debugger to a Python process?

http://wiki.python.org/moin/DebuggingWithGdb

Is there a way to attach a debugger to a multi-threaded Python process?

Overall, it seems winpdb can do what I need (I'm under Windows), but I haven't tested it.

Community
  • 1
  • 1
max
  • 49,282
  • 56
  • 208
  • 355