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
a83cdaae
Kaydet (Commit)
a83cdaae
authored
Tem 09, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12326: document the recommended idiom for checking sys.platform on Unix systems.
Also, point to the various alternatives.
üst
00ebeb54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
os.rst
Doc/library/os.rst
+7
-0
sys.rst
Doc/library/sys.rst
+12
-0
No files found.
Doc/library/os.rst
Dosyayı görüntüle @
a83cdaae
...
...
@@ -61,6 +61,13 @@ Notes on the availability of these functions:
names have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``,
``'os2'``, ``'ce'``, ``'java'``.
.. seealso::
:attr:`sys.platform` has a finer granularity. :func:`os.uname` gives
system-dependent version information.
The :mod:`platform` module provides detailed checks for the
system's identity.
.. _os-filenames:
...
...
Doc/library/sys.rst
Dosyayı görüntüle @
a83cdaae
...
...
@@ -714,6 +714,12 @@ always available.
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*.
Unless you want to test for a specific system version, it is therefore
recommended to use the following idiom::
if sys.platform.startswith('linux'):
# Linux-specific code here...
For other systems, the values are:
================ ===========================
...
...
@@ -726,6 +732,12 @@ always available.
OS/2 EMX ``'os2emx'``
================ ===========================
.. seealso::
:attr:`os.name` has a coarser granularity. :func:`os.uname` gives
system-dependent version information.
The :mod:`platform` module provides detailed checks for the
system's identity.
.. data:: prefix
...
...
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