How to get the running process' pid in Python?

How to get the running process' pid in Python?

asked Jun 5, 2017 by dtivl (2,500 points)

1 Answer

In Python, you can get the pid of the current process by

import os

os.getpid()

From the official doc:

os.getpid()

Return the current process id.
answered Jun 5, 2017 by dtivl (2,500 points)

Please log in or register to answer this question.

Related questions

1 answer
1 answer
1 answer
1 answer
1 answer
1 answer
1 answer
Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...