On this page
platform.machine
Prev: platform.mac_ver | Up: platform | Next: platform.node
Rel: platform.android_ver, platform.AndroidVer, platform.architecture, platform.freedesktop_os_release
Ref: docs.python.org — platform.machine
Tags: #public #python3 #stdlib #platform
Import
import platform
from platform import machine
Signature & Overview
platform.machine()
Returns the machine type, e.g. 'i386' An empty string is returned if the value cannot be determined.
Usage
import platform
m = platform.machine()
assert isinstance(m, str) and len(m) > 0
Gotchas
- Architecture names vary by OS: e.g.,
"arm64"on macOS vs."aarch64"on Linux,"AMD64"on Windows vs."x86_64"on Unix.
REPL Inspect
from platform import machine
help(machine)
Linked from
Related notes
- tuts/python3/stdlib_module/platform/mac_ver Linked here; links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/node Linked here; links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/android_ver Linked here; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/AndroidVer Linked here; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/architecture Linked here; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/freedesktop_os_release Linked here; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/platform Linked here; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/platform/invalidate_caches shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/ios_ver shared tags: #platform, #stdlib