How to remotely debug long python scripts or services?

Pretty much what the title says, I would like to be able to connect to a python process running under pasteur or uwsgi and use the pdb functions.

+6
source share
1 answer

Using winpdb , you can connect to the current process, like this:

  • Embed

    import rpdb2; rpdb2.start_embedded_debugger('mypassword') 

    inside the script.

  • Run the script (via pasteur or uwsgi) as usual.
  • Run winpdb
  • Click File> Attach
  • Enter the password (for example, "mypassword"), select the process.
  • To disconnect, click File> Disconnect. The script will continue to work and can be attached to it later.
+3
source

Source: https://habr.com/ru/post/895170/


All Articles