popen2
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/popen2.py
Module Docs

Spawn a command with pipes to its stdin, stdout, and optionally stderr.
 
The normal os.popen(cmd, mode) call spawns a shell command and provides a
file interface to just the input or output of the process depending on
whether mode is 'r' or 'w'.  This module provides the functions popen2(cmd)
and popen3(cmd) which return two or three pipes to the spawned command.

 
Modules
       
os
sys
warnings

 
Classes
       
Popen3
Popen4

 
class Popen3
    Class representing a child process.  Normally, instances are created
internally by the functions popen2() and popen3().
 
  Methods defined here:
__del__(self)
__init__(self, cmd, capturestderr=False, bufsize=-1)
The parameter 'cmd' is the shell command to execute in a
sub-process.  On UNIX, 'cmd' may be a sequence, in which case arguments
will be passed directly to the program without shell intervention (as
with os.spawnv()).  If 'cmd' is a string it will be passed to the shell
(as with os.system()).   The 'capturestderr' flag, if true, specifies
that the object should capture standard error output of the child
process.  The default is false.  If the 'bufsize' parameter is
specified, it specifies the size of the I/O buffers to/from the child
process.
poll(self, _deadstate=None)
Return the exit status of the child process if it has finished,
or -1 if it hasn't finished yet.
wait(self)
Wait for and return the exit status of the child process.

Data and other attributes defined here:
sts = -1

 
class Popen4(Popen3)
     Methods defined here:
__init__(self, cmd, bufsize=-1)

Data and other attributes defined here:
childerr = None

Methods inherited from Popen3:
__del__(self)
poll(self, _deadstate=None)
Return the exit status of the child process if it has finished,
or -1 if it hasn't finished yet.
wait(self)
Wait for and return the exit status of the child process.

Data and other attributes inherited from Popen3:
sts = -1

 
Functions
       
popen2(cmd, bufsize=-1, mode='t')
Execute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
be a sequence, in which case arguments will be passed directly to the
program without shell intervention (as with os.spawnv()). If 'cmd' is a
string it will be passed to the shell (as with os.system()). If
'bufsize' is specified, it sets the buffer size for the I/O pipes. The
file objects (child_stdout, child_stdin) are returned.
popen3(cmd, bufsize=-1, mode='t')
Execute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
be a sequence, in which case arguments will be passed directly to the
program without shell intervention (as with os.spawnv()). If 'cmd' is a
string it will be passed to the shell (as with os.system()). If
'bufsize' is specified, it sets the buffer size for the I/O pipes. The
file objects (child_stdout, child_stdin, child_stderr) are returned.
popen4(cmd, bufsize=-1, mode='t')
Execute the shell command 'cmd' in a sub-process. On UNIX, 'cmd' may
be a sequence, in which case arguments will be passed directly to the
program without shell intervention (as with os.spawnv()). If 'cmd' is a
string it will be passed to the shell (as with os.system()). If
'bufsize' is specified, it sets the buffer size for the I/O pipes. The
file objects (child_stdout_stderr, child_stdin) are returned.

 
Data
        __all__ = ['popen2', 'popen3', 'popen4', 'Popen3', 'Popen4']