How to debug long running python scripts or services remotely?

半世苍凉 提交于 2019-12-03 07:53:26

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.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!