On this page
os.getppid
Prev: os.getpid | Up: os | Next: os.kill
Rel: os.abort, os.access, os.chdir, os.chmod
Ref: docs.python.org — os.getppid
Tags: #public #python3 #stdlib #os
Import
import os
from os import getppid
Signature & Overview
os.getppid()
Return the parent's process id.
Usage
import os
ppid = os.getppid()
assert isinstance(ppid, int) and ppid >= 0
Gotchas
- Parent process ID: On Unix, if the original parent exits,
getppid()typically becomes1(init/launchd) or a subreaper PID.
REPL Inspect
from os import getppid
help(getppid)
Linked from
Related notes
- tuts/python3/stdlib_module/os/getpid Linked here; links to this page; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/kill Linked here; links to this page; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/os/abort Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/access Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chdir Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chmod Linked here; shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/chown shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/close shared tags: #os, #stdlib
- tuts/python3/stdlib_module/os/cpu_count shared tags: #os, #stdlib