Check what a running process is doing: print stack trace of an uninstrumented Python program

前端 未结 5 1689
[愿得一人]
[愿得一人] 2021-02-07 02:07

Is there a way on Linux to check what a running Python daemon process is doing? That is, without instrumenting the code and without terminating it? Preferably I\'d like to get t

5条回答
  •  终归单人心
    2021-02-07 03:01

    winpdb allows you to attach to a running python process, but to do this, you must start the python process this way:

     rpdb2 -d -r script.py
    

    Then, after setting a password:

    A password should be set to secure debugger client-server communication.
    Please type a password:mypassword
    

    you could launch winpdb to File>Attach to (or File>Detach from) the process.

提交回复
热议问题