开发者

How to debug long running python scripts or services remotely?

Pretty much what the title says, I would like to be able to connect to a python process running under paster or 开发者_运维技巧uwsgi and utilize pdb functionality.


Using winpdb, you can attach to a running process like this:

  1. Insert

    import rpdb2; rpdb2.start_embedded_debugger('mypassword')
    

    inside your script.

  2. Launch your script (through paster or uwsgi) as usual.
  3. Run winpdb
  4. Click File>Attach
  5. Type in password (e.g. "mypassword"), select the process.
  6. To detach, click File>Detach. The script will continue to run, and can be attached to again later.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜