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
6ab5d083
Kaydet (Commit)
6ab5d083
authored
Ara 20, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#7381: subprocess documentation and library docstring consistency fixes.
üst
819a8fa0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
subprocess.rst
Doc/library/subprocess.rst
+9
-7
subprocess.py
Lib/subprocess.py
+9
-9
No files found.
Doc/library/subprocess.rst
Dosyayı görüntüle @
6ab5d083
...
...
@@ -126,9 +126,10 @@ This module defines one class called :class:`Popen`:
.. note::
This feature is only available if Python is built with universal newline support
(the default). Also, the newlines attribute of the file objects :attr:`stdout`,
:attr:`stdin` and :attr:`stderr` are not updated by the communicate() method.
This feature is only available if Python is built with universal newline
support (the default). Also, the newlines attribute of the file objects
:attr:`stdout`, :attr:`stdin` and :attr:`stderr` are not updated by the
communicate() method.
The *startupinfo* and *creationflags*, if given, will be passed to the
underlying CreateProcess() function. They can specify things such as appearance
...
...
@@ -162,7 +163,7 @@ This module also defines two shortcut functions:
The arguments are the same as for the Popen constructor. Example::
retcode =
call(["ls", "-l"])
>>> retcode = subprocess.
call(["ls", "-l"])
.. warning::
...
...
@@ -181,7 +182,8 @@ This module also defines two shortcut functions:
The arguments are the same as for the Popen constructor. Example::
check_call(["ls", "-l"])
>>> subprocess.check_call(["ls", "-l"])
0
.. versionadded:: 2.5
...
...
@@ -208,8 +210,8 @@ This module also defines two shortcut functions:
To capture standard error in the result, use ``stderr=subprocess.STDOUT``::
>>> subprocess.check_output(
["/bin/sh", "-c", "ls non_existent_file
; exit 0"],
stderr=subprocess.STDOUT)
... ["/bin/sh", "-c", "ls non_existent_file
; exit 0"],
...
stderr=subprocess.STDOUT)
'ls: non_existent_file: No such file or directory\n'
.. versionadded:: 2.7
...
...
Lib/subprocess.py
Dosyayı görüntüle @
6ab5d083
...
...
@@ -128,15 +128,15 @@ check_call(*popenargs, **kwargs):
check_call(["ls", "-l"])
check_output(*popenargs, **kwargs):
Run command with arguments and return its output as a byte string.
Run command with arguments and return its output as a byte string.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.
The arguments are the same as for the Popen constructor. Example:
The arguments are the same as for the Popen constructor. Example:
output = subprocess.check_output(["ls", "-l", "/dev/null"])
output = subprocess.check_output(["ls", "-l", "/dev/null"])
Exceptions
----------
...
...
@@ -505,7 +505,7 @@ def check_call(*popenargs, **kwargs):
def
check_output
(
*
popenargs
,
**
kwargs
):
"""Run command with arguments and return its output as a byte string.
r
"""Run command with arguments and return its output as a byte string.
If the exit code was non-zero it raises a CalledProcessError. The
CalledProcessError object will have the return code in the returncode
...
...
@@ -520,8 +520,8 @@ def check_output(*popenargs, **kwargs):
To capture standard error in the result, use stderr=subprocess.STDOUT.
>>> check_output(["/bin/sh", "-c",
"ls -l non_existent_file ; exit 0"],
stderr=subprocess.STDOUT)
...
"ls -l non_existent_file ; exit 0"],
...
stderr=subprocess.STDOUT)
'ls: non_existent_file: No such file or directory\n'
"""
if
'stdout'
in
kwargs
:
...
...
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