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
6afad379
Kaydet (Commit)
6afad379
authored
Nis 28, 1998
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
popen2 section for the library reference, contributed by Drew Csillag, with
some reorganization.
üst
2a1cc3e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
0 deletions
+142
-0
libpopen2.tex
Doc/lib/libpopen2.tex
+71
-0
libpopen2.tex
Doc/libpopen2.tex
+71
-0
No files found.
Doc/lib/libpopen2.tex
0 → 100644
Dosyayı görüntüle @
6afad379
% This section was contributed by Drew Csillag
% <drew_csillag@geocities.com>, with some re-organization by Fred L.
% Drake, Jr. <fdrake@acm.org>.
\section
{
Standard Module
\module
{
popen2
}}
\label
{
module-popen2
}
\stmodindex
{
popen2
}
This module allows you to spawn processes and connect their
input/output/error pipes and obtain their return codes.
The primary interface offered by this module is a pair of factory
functions:
\begin{funcdesc}
{
popen2
}{
cmd
\optional
{
, bufsize
}}
Executes
\var
{
cmd
}
as a sub-process. If
\var
{
bufsize
}
is specified,
it specifies the buffer size for the I/O pipes. Returns
\code
{
(
\var
{
child
_
stdout
}
,
\var
{
child
_
stdin
}
)
}
.
\end{funcdesc}
\begin{funcdesc}
{
popen2
}{
cmd
\optional
{
, bufsize
}}
Executes
\var
{
cmd
}
as a sub-process. If
\var
{
bufsize
}
is specified,
it specifies the buffer size for the I/O pipes. Returns
\code
{
(
\var
{
child
_
stdout
}
,
\var
{
child
_
stdin
}
,
\var
{
child
_
stderr
}
)
}
.
\end{funcdesc}
The class defining the objects returned by the factory functions is
also available:
\begin{classdesc}
{
Popen3
}{
cmd
\optional
{
, capturestderr
\optional
{
, bufsize
}}}
This class represents a child process. Normally,
\class
{
Popen3
}
instances are created using the factory functions described above.
If not using one off the helper functions to create
\class
{
Popen3
}
objects, the parameter
\var
{
cmd
}
is the shell command to execute in a
sub-process. The
\var
{
capturestderr
}
flag, if true, specifies that
the object should capture standard error output of the child process.
The default is false. If the
\var
{
bufsize
}
parameter is specified, it
specifies the size of the I/O buffers to/from the child process.
\end{classdesc}
\subsection
{
Popen3 Objects
}
\label
{
popen3-objects
}
Instances of the
\class
{
Popen3
}
class have the following methods:
\begin{methoddesc}
{
poll
}{}
Returns
\code
{
-1
}
if child process hasn't completed yet, or its return
code otherwise.
\end{methoddesc}
\begin{methoddesc}
{
wait
}{}
Waits for and returns the return code of the child process.
\end{methoddesc}
The following attributes of
\class
{
Popen3
}
objects are also available:
\begin{datadesc}
{
fromchild
}
A file object that provides output from the child process.
\end{datadesc}
\begin{datadesc}
{
tochild
}
A file object that provides input to the child process.
\end{datadesc}
\begin{datadesc}
{
childerr
}
Where the standard error from the child process goes is
\var
{
capturestderr
}
was true for the constructor, or
\code
{
None
}
.
\end{datadesc}
Doc/libpopen2.tex
0 → 100644
Dosyayı görüntüle @
6afad379
% This section was contributed by Drew Csillag
% <drew_csillag@geocities.com>, with some re-organization by Fred L.
% Drake, Jr. <fdrake@acm.org>.
\section
{
Standard Module
\module
{
popen2
}}
\label
{
module-popen2
}
\stmodindex
{
popen2
}
This module allows you to spawn processes and connect their
input/output/error pipes and obtain their return codes.
The primary interface offered by this module is a pair of factory
functions:
\begin{funcdesc}
{
popen2
}{
cmd
\optional
{
, bufsize
}}
Executes
\var
{
cmd
}
as a sub-process. If
\var
{
bufsize
}
is specified,
it specifies the buffer size for the I/O pipes. Returns
\code
{
(
\var
{
child
_
stdout
}
,
\var
{
child
_
stdin
}
)
}
.
\end{funcdesc}
\begin{funcdesc}
{
popen2
}{
cmd
\optional
{
, bufsize
}}
Executes
\var
{
cmd
}
as a sub-process. If
\var
{
bufsize
}
is specified,
it specifies the buffer size for the I/O pipes. Returns
\code
{
(
\var
{
child
_
stdout
}
,
\var
{
child
_
stdin
}
,
\var
{
child
_
stderr
}
)
}
.
\end{funcdesc}
The class defining the objects returned by the factory functions is
also available:
\begin{classdesc}
{
Popen3
}{
cmd
\optional
{
, capturestderr
\optional
{
, bufsize
}}}
This class represents a child process. Normally,
\class
{
Popen3
}
instances are created using the factory functions described above.
If not using one off the helper functions to create
\class
{
Popen3
}
objects, the parameter
\var
{
cmd
}
is the shell command to execute in a
sub-process. The
\var
{
capturestderr
}
flag, if true, specifies that
the object should capture standard error output of the child process.
The default is false. If the
\var
{
bufsize
}
parameter is specified, it
specifies the size of the I/O buffers to/from the child process.
\end{classdesc}
\subsection
{
Popen3 Objects
}
\label
{
popen3-objects
}
Instances of the
\class
{
Popen3
}
class have the following methods:
\begin{methoddesc}
{
poll
}{}
Returns
\code
{
-1
}
if child process hasn't completed yet, or its return
code otherwise.
\end{methoddesc}
\begin{methoddesc}
{
wait
}{}
Waits for and returns the return code of the child process.
\end{methoddesc}
The following attributes of
\class
{
Popen3
}
objects are also available:
\begin{datadesc}
{
fromchild
}
A file object that provides output from the child process.
\end{datadesc}
\begin{datadesc}
{
tochild
}
A file object that provides input to the child process.
\end{datadesc}
\begin{datadesc}
{
childerr
}
Where the standard error from the child process goes is
\var
{
capturestderr
}
was true for the constructor, or
\code
{
None
}
.
\end{datadesc}
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