How to get the process ID of python programm?
Question:
Is there a way to get the process ID (PID) of a python program?
The program was started from the command line.
Answers:
this should do it:
import os
pid = os.getpid()
print(pid)
Is there a way to get the process ID (PID) of a python program?
The program was started from the command line.
this should do it:
import os
pid = os.getpid()
print(pid)