[Python] How to find the PID of a process?

Discussão em 'Python' iniciado por Stack, Agosto 17, 2025.

  1. Stack

    Stack Membro Participativo

    I am running a script in Linux by calling python test09.py&. In another shell, I can use the ps command to get the process ID of the running script:

    ps -ef | grep "python test09.py&"


    How can I get the PID of that script using python code instead?

    Continue reading...

Compartilhe esta Página