Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
795eaeb4
Kaydet (Commit)
795eaeb4
authored
Agu 21, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12326: update sys.platform doc for Linux
üst
e6747472
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
sys.rst
Doc/library/sys.rst
+12
-7
No files found.
Doc/library/sys.rst
Dosyayı görüntüle @
795eaeb4
...
@@ -702,20 +702,21 @@ always available.
...
@@ -702,20 +702,21 @@ always available.
This string contains a platform identifier that can be used to append
This string contains a platform identifier that can be used to append
platform-specific components to :data:`sys.path`, for instance.
platform-specific components to :data:`sys.path`, for instance.
For Unix systems,
this is the lowercased OS name as returned by ``uname -s``
For Unix systems,
except on Linux, this is the lowercased OS name as
with the first part of the version as returned by ``uname -r`` appended,
returned by ``uname -s`` with the first part of the version as returned by
e.g. ``'sunos5'`` or ``'linux2'``, *at the time when Python was built*.
``uname -r`` appended, e.g. ``'sunos5'`` or ``'freebsd8'``, *at the time
Unless you want to test for a specific system version, it is therefore
when Python was built*. Unless you want to test for a specific system
recommended to use the following idiom::
version, it is therefore
recommended to use the following idiom::
if sys.platform.startswith('
linux
'):
if sys.platform.startswith('
freebsd
'):
#
Linux
-specific code here...
#
FreeBSD
-specific code here...
For other systems, the values are:
For other systems, the values are:
================ ===========================
================ ===========================
System :data:`platform` value
System :data:`platform` value
================ ===========================
================ ===========================
Linux ``'linux'``
Windows ``'win32'``
Windows ``'win32'``
Windows/Cygwin ``'cygwin'``
Windows/Cygwin ``'cygwin'``
Mac OS X ``'darwin'``
Mac OS X ``'darwin'``
...
@@ -723,6 +724,10 @@ always available.
...
@@ -723,6 +724,10 @@ always available.
OS/2 EMX ``'os2emx'``
OS/2 EMX ``'os2emx'``
================ ===========================
================ ===========================
.. versionchanged:: 3.3
On Linux, :attr:`sys.platform` doesn't contain the major version anymore.
It is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``.
.. seealso::
.. seealso::
:attr:`os.name` has a coarser granularity. :func:`os.uname` gives
:attr:`os.name` has a coarser granularity. :func:`os.uname` gives
system-dependent version information.
system-dependent version information.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment