ID EN
Sys

platform

Python 3.11

This string contains a platform identifier that can be used to append platform-specific components to sys.path, for instance.

Syntax

PYTHON
sys.platform

Examples

Example 1
PYTHON
if sys.platform.startswith('freebsd'):
     FreeBSD-specific code here...
elif sys.platform.startswith('linux'):
     Linux-specific code here...
elif sys.platform.startswith('aix'):
     AIX-specific code here...

See Also

sys.path sys.platform sys.platform os.name os.uname() platform