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:
Insert
import rpdb2; rpdb2.start_embedded_debugger('mypassword')
inside your script.
- Launch your script (through paster or uwsgi) as usual.
- Run winpdb
- Click File>Attach
- Type in password (e.g. "mypassword"), select the process.
- To detach, click File>Detach. The script will continue to run, and can be attached to again later.
精彩评论