On this page
sysconfig.get_platform
Prev: sysconfig.get_paths | Up: sysconfig | Next: sysconfig.get_python_version
Rel: sysconfig.get_config_h_filename, sysconfig.get_config_var, sysconfig.get_config_vars, sysconfig.get_makefile_filename
Ref: docs.python.org — sysconfig.get_platform
Tags: #public #python3 #stdlib #sysconfig
Import
import sysconfig
from sysconfig import get_platform
Signature & Overview
sysconfig.get_platform()
Return a string that identifies the current platform.
Usage
import sysconfig
p = sysconfig.get_platform()
assert isinstance(p, str) and len(p) > 0
Gotchas
- Matches wheel/packaging platform tags (e.g.,
'macosx-15.0-arm64','linux-x86_64','win-amd64').
REPL Inspect
from sysconfig import get_platform
help(get_platform)
Linked from
Related notes
- tuts/python3/stdlib_module/sysconfig/get_paths Linked here; links to this page; shared tags: #stdlib, #sysconfig
- tuts/python3/stdlib_module/sysconfig/get_python_version Linked here; links to this page; shared tags: #stdlib, #sysconfig
- tuts/python3/stdlib_module/sysconfig Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sysconfig/get_config_h_filename Linked here; shared tags: #stdlib, #sysconfig
- tuts/python3/stdlib_module/sysconfig/get_config_var Linked here; shared tags: #stdlib, #sysconfig
- tuts/python3/stdlib_module/sysconfig/get_config_vars Linked here; shared tags: #stdlib, #sysconfig
- tuts/python3/stdlib_module/sysconfig/get_makefile_filename Linked here; shared tags: #stdlib, #sysconfig
- tuts/python3/stdlib_module/sysconfig/get_path shared tags: #stdlib, #sysconfig
- tuts/python3/stdlib_module/sysconfig/get_path_names shared tags: #stdlib, #sysconfig
- tuts/python3/stdlib_module/sysconfig/get_scheme_names shared tags: #stdlib, #sysconfig