Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python interpreter: interrupt and continue

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.

like image 369
max Avatar asked Nov 16 '10 19:11

max


2 Answers

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:

  • http://docs.python.org/library/pdb.html

Here's a nice tutorial btw:

  • http://onlamp.com/pub/a/python/2005/09/01/debugger.html
like image 53
icyrock.com Avatar answered Sep 20 '22 12:09

icyrock.com


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.

like image 39
max Avatar answered Sep 16 '22 12:09

max