On this page
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
- Import via
os.cpu_count(): May returnNone.
REPL Inspect
from posix import cpu_count
help(cpu_count)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/confstr Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/ctermid Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posix/abort Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/access Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chdir Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chflags Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chmod shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chown shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chroot shared tags: #posix, #stdlib