Python os.getpid() Method
Example
Find the current process id:
#Import os Library
import os
#print the current process id
print (os.getpid())
Try it Yourself »
Definition and Usage
The os.getpid()
method returns the process id of the current process.
Note: Available on UNIX and Windows platforms.
Syntax
os.getpid()
Technical Details
Return Value: | An int value, returns the current process id |
---|---|
Python Version: | 2.6 |