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

posix.cpu_count

Prev: posix.confstr | Up: posix | Next: posix.ctermid
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.cpu_count
Tags: #public #python3 #stdlib #posix


Import

import posix
from posix import cpu_count

Signature & Overview

posix.cpu_count()

Return the number of logical CPUs in the system.

Usage

import os

assert (os.cpu_count() or 1) >= 1

Gotchas

REPL Inspect

from posix import cpu_count
help(cpu_count)

Linked from

Related notes