Python os.getppid() Method
Example
Find the parent process id of the current process:
#Import os Library
import os
#print the parent process id
print (os.getppid())
Try it Yourself »
Definition and Usage
The os.getppid()
method returns the parent process id of the current process.
Note: Available on UNIX and Windows platforms.
Syntax
os.getppid()
Technical Details
Return Value: | An int value, representing the parent process id |
---|---|
Change Log: | 3.2 - Added support for Windows |