views:

243

answers:

1

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:

  1. 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
    
  2. 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

  3. You can optionally run pdb manually - see: http://docs.python.org/library/pdb.html

rlotun
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
No problem. In fact, if you find any other different methods please let me know!
rlotun
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
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