如何逐步调试扭曲?

时间:2010-03-23 15:26:13

标签: python netbeans debugging twisted

我希望能够在Netbeans中调试Punjab,一个扭曲的python应用程序,以便我可以逐步完成代码。我怎样才能做到这一点?或者,我怎么能在不同的调试器中做到这一点?

1 个答案:

答案 0 :(得分:10)

由于您正在尝试调试扭曲的应用程序,因此您有以下几种选择:

  1. 如果您通过twistd运行,则可以使用-b命令行选项:

       -b, --debug            run the application in the Python Debugger (implies
                              nodaemon), sending SIGUSR2 will drop into debugger
    
  2. 您可以在扭曲的过程中运行沙井 - 这允许您远程登录到服务器并检查Python对象 - http://twistedmatrix.com/documents/current/core/howto/telnet.html

  3. 您可以选择手动运行pdb - 请参阅:http://docs.python.org/library/pdb.html