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
f5d5a663
Kaydet (Commit)
f5d5a663
authored
Ara 06, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Follow-up to #4488: document PIPE and STDOUT properly.
üst
826f3fef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
18 deletions
+33
-18
subprocess.rst
Doc/library/subprocess.rst
+33
-18
No files found.
Doc/library/subprocess.rst
Dosyayı görüntüle @
f5d5a663
...
@@ -73,13 +73,13 @@ This module defines one class called :class:`Popen`:
...
@@ -73,13 +73,13 @@ This module defines one class called :class:`Popen`:
specified by the :envvar:`COMSPEC` environment variable.
specified by the :envvar:`COMSPEC` environment variable.
*stdin*, *stdout* and *stderr* specify the executed programs' standard input,
*stdin*, *stdout* and *stderr* specify the executed programs' standard input,
standard output and standard error file handles, respectively. Valid values
are
standard output and standard error file handles, respectively. Valid values
``PIPE``, an existing file descriptor (a positive integer), an existing file
are :data:`PIPE`, an existing file descriptor (a positive integer), an
object, and ``None``. ``PIPE`` indicates that a new pipe to the child should b
e
existing file object, and ``None``. :data:`PIPE` indicates that a new pip
e
created. With ``None``, no redirection will occur; the child's file handles
to the child should be created. With ``None``, no redirection will occur;
will be inherited from the parent. Additionally, *stderr* can be ``STDOUT``
,
the child's file handles will be inherited from the parent. Additionally
,
which indicates that the stderr data from the applications should be captured
*stderr* can be :data:`STDOUT`, which indicates that the stderr data from the
into the same file handle as for stdout.
applications should be captured
into the same file handle as for stdout.
If *preexec_fn* is set to a callable object, this object will be called in the
If *preexec_fn* is set to a callable object, this object will be called in the
child process just before the child is executed. (Unix only)
child process just before the child is executed. (Unix only)
...
@@ -119,6 +119,20 @@ This module defines one class called :class:`Popen`:
...
@@ -119,6 +119,20 @@ This module defines one class called :class:`Popen`:
of the main window and priority for the new process. (Windows only)
of the main window and priority for the new process. (Windows only)
.. data:: PIPE
Special value that can be used as the *stdin*, *stdout* or *stderr* argument
to :class:`Popen` and indicates that a pipe to the standard stream should be
opened.
.. data:: STDOUT
Special value that can be used as the *stderr* argument to :class:`Popen` and
indicates that standard error should go into the same handle as standard
output.
Convenience Functions
Convenience Functions
^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^
...
@@ -285,20 +299,21 @@ The following attributes are also available:
...
@@ -285,20 +299,21 @@ The following attributes are also available:
.. attribute:: Popen.stdin
.. attribute:: Popen.stdin
If the *stdin* argument
is ``PIPE``, this attribute is a file object tha
t
If the *stdin* argument
was :data:`PIPE`, this attribute is a file objec
t
provides input to the child process. Otherwise, it is ``None``.
that
provides input to the child process. Otherwise, it is ``None``.
.. attribute:: Popen.stdout
.. attribute:: Popen.stdout
If the *stdout* argument
is ``PIPE``, this attribute is a file object tha
t
If the *stdout* argument
was :data:`PIPE`, this attribute is a file objec
t
provides output from the child process. Otherwise, it is ``None``.
that
provides output from the child process. Otherwise, it is ``None``.
.. attribute:: Popen.stderr
.. attribute:: Popen.stderr
If the *stderr* argument is ``PIPE``, this attribute is file object that
If the *stderr* argument was :data:`PIPE`, this attribute is a file object
provides error output from the child process. Otherwise, it is ``None``.
that provides error output from the child process. Otherwise, it is
``None``.
.. attribute:: Popen.pid
.. attribute:: Popen.pid
...
@@ -478,15 +493,15 @@ Replacing functions from the popen2 module
...
@@ -478,15 +493,15 @@ Replacing functions from the popen2 module
stdin=PIPE, stdout=PIPE, close_fds=True)
stdin=PIPE, stdout=PIPE, close_fds=True)
(child_stdout, child_stdin) = (p.stdout, p.stdin)
(child_stdout, child_stdin) = (p.stdout, p.stdin)
The popen2.Popen3 and popen2.Popen4 basically works as subprocess.Popen, except
:class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as
that:
:class:`subprocess.Popen`, except
that:
*
subprocess.Popen raises an exception if the execution fails
*
:class:`Popen` raises an exception if the execution fails.
* the *capturestderr* argument is replaced with the *stderr* argument.
* the *capturestderr* argument is replaced with the *stderr* argument.
*
stdin=PIPE and stdout=PIPE
must be specified.
*
``stdin=PIPE`` and ``stdout=PIPE``
must be specified.
* popen2 closes all file descriptors by default, but you have to specify
* popen2 closes all file descriptors by default, but you have to specify
close_fds=True with subprocess.Popen
.
``close_fds=True`` with :class:`Popen`
.
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