On this page
  1. os.getpid
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

os.getpid

Prev: os.getenv | Up: os | Next: os.getppid
Rel: os.abort, os.access, os.chdir, os.chmod
Ref: docs.python.org — os.getpid
Tags: #public #python3 #stdlib #os


Import

import os
from os import getpid

Signature & Overview

os.getpid()

Return the current process id.

Usage

import os

pid = os.getpid()
assert isinstance(pid, int) and pid > 0

Gotchas

REPL Inspect

from os import getpid
help(getpid)

Linked from

Related notes