On this page
platform.architecture
Prev: platform.AndroidVer | Up: platform | Next: platform.freedesktop_os_release
Rel: platform.android_ver, platform.AndroidVer, platform.freedesktop_os_release, platform.invalidate_caches
Ref: docs.python.org — platform.architecture
Tags: #public #python3 #stdlib #platform
Import
import platform
from platform import architecture
Signature & Overview
platform.architecture(executable='/opt/homebrew/opt/python@3.14/bin/python3.14', bits='', linkage='')
Queries the given executable (defaults to the Python interpreter binary) for various architecture information.
Usage
import platform
bits, linkage = platform.architecture()
assert bits in ("32bit", "64bit")
Gotchas
- Prefer
sys.maxsize > 2**32to check if the current Python interpreter is 64-bit—architecture()can be misleading on macOS universal binaries.
REPL Inspect
from platform import architecture
help(architecture)
Linked from
- tuts/python3/stdlib_module/platform
- tuts/python3/stdlib_module/platform/android_ver
- tuts/python3/stdlib_module/platform/AndroidVer
- tuts/python3/stdlib_module/platform/freedesktop_os_release
- tuts/python3/stdlib_module/platform/invalidate_caches
- tuts/python3/stdlib_module/platform/ios_ver
- tuts/python3/stdlib_module/platform/IOSVersionInfo
- tuts/python3/stdlib_module/platform/java_ver
- tuts/python3/stdlib_module/platform/libc_ver
- tuts/python3/stdlib_module/platform/mac_ver
- tuts/python3/stdlib_module/platform/machine
- tuts/python3/stdlib_module/platform/node
- tuts/python3/stdlib_module/platform/platform
- tuts/python3/stdlib_module/platform/processor
- tuts/python3/stdlib_module/platform/python_branch
- tuts/python3/stdlib_module/platform/python_build
- tuts/python3/stdlib_module/platform/python_compiler
- tuts/python3/stdlib_module/platform/python_implementation
- tuts/python3/stdlib_module/platform/python_revision
- tuts/python3/stdlib_module/platform/python_version
- tuts/python3/stdlib_module/platform/python_version_tuple
- tuts/python3/stdlib_module/platform/release
- tuts/python3/stdlib_module/platform/system
- tuts/python3/stdlib_module/platform/system_alias
- tuts/python3/stdlib_module/platform/uname
- tuts/python3/stdlib_module/platform/uname_result
- tuts/python3/stdlib_module/platform/version
- tuts/python3/stdlib_module/platform/win32_edition
- tuts/python3/stdlib_module/platform/win32_is_iot
- tuts/python3/stdlib_module/platform/win32_ver
Related notes
- tuts/python3/stdlib_module/platform/android_ver Linked here; links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/AndroidVer Linked here; links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/freedesktop_os_release Linked here; links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/invalidate_caches Linked here; links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/platform Linked here; links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/ios_ver links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/IOSVersionInfo links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/java_ver links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/libc_ver links to this page; shared tags: #platform, #stdlib
- tuts/python3/stdlib_module/platform/mac_ver links to this page; shared tags: #platform, #stdlib