问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/7082093/how-to-debug-long-running-python-scripts-or-services-remotely