I'd like to be able to debug Punjab, a twisted python application, in Netbeans so that I can step through the code. How can I do that? Alternatively, how could I do it in a different debugger?
+3
A:
Since you're trying to debug a twisted application, you have a few options:
If you're running via twistd you can use the -b command-line options:
-b, --debug run the application in the Python Debugger (implies nodaemon), sending SIGUSR2 will drop into debugger
You can run manhole in your twisted process - this allows you to telnet into the server and examine Python objects - http://twistedmatrix.com/documents/current/core/howto/telnet.html
You can optionally run pdb manually - see: http://docs.python.org/library/pdb.html
rlotun
2010-03-23 16:49:34
I'm just starting to use `twisted` and thanks for tips on how to debug twisted. With twisted event loop and stuff its hard to debug in the conventional way and I'm hoping there are more answers to this question.
jeffjose
2010-03-29 18:23:07
No problem. In fact, if you find any other different methods please let me know!
rlotun
2010-03-29 19:58:38
Thanks for the response. I too am hoping there is a way to use a graphical debugger, but shall mark this as the best available answer.
lb
2010-04-12 21:49:34
I should also mention that I recently found out the Wing IDE has Twisted debugging support (see http://www.wingware.com/doc/howtos/twisted)
rlotun
2010-04-13 06:18:39