#799369: document possible sys.platform values.

This commit is contained in:
Georg Brandl 2008-01-20 12:57:47 +00:00
parent d5e6cf2b15
commit 440f2fff14
1 changed files with 20 additions and 3 deletions

View File

@ -507,9 +507,26 @@ always available.
.. data:: platform .. data:: platform
This string contains a platform identifier, e.g. ``'sunos5'`` or ``'linux1'``. This string contains a platform identifier that can be used to append
This can be used to append platform-specific components to ``path``, for platform-specific components to :data:`sys.path`, for instance.
instance.
For Unix systems, this is the lowercased OS name as returned by ``uname -s``
with the first part of the version as returned by ``uname -r`` appended,
e.g. ``'sunos5'`` or ``'linux2'``, *at the time when Python was built*.
For other systems, the values are:
================ ===========================
System :data:`platform` value
================ ===========================
Windows ``'win32'``
Windows/Cygwin ``'cygwin'``
MacOS X ``'darwin'``
MacOS 9 ``'mac'``
OS/2 ``'os2'``
OS/2 EMX ``'os2emx'``
RiscOS ``'riscos'``
AtheOS ``'atheos'``
================ ===========================
.. data:: prefix .. data:: prefix