Module Expr Str Import alias Import alias Import alias Assign NameStore ListLoad Str Str Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Str handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore Num Assign NameStore ListLoad FunctionDef arguments args defaults body For NameStore SubscriptLoad NameLoad Slice body If CompareGtE Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Num body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass decorator_list ClassDef bases body Expr Str Assign NameStore Num FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Num body Expr Str Expr Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TryFinally body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Num If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad finalbody Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str NameLoad orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If CompareLt AttributeLoad NameLoad attr Num body If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body Assign NameStore ListLoad Str Str NameLoad For NameStore Call NameLoad Num NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass TryFinally body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num NameLoad finalbody Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareLt AttributeLoad NameLoad attr Num body TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareLt AttributeLoad NameLoad attr Num body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assert CompareEq NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TryFinally body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad finalbody Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str NameLoad decorator_list decorator_list If BoolOpOr CompareEq SubscriptLoad AttributeLoad NameLoad attr Slice Num Str CompareEq AttributeLoad NameLoad attr Str body Delete NameDel NameDel FunctionDef arguments args NameParam NameParam NameParam defaults Num Str body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Str body Expr Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Str body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list orelse FunctionDef arguments args NameParam NameParam NameParam defaults Num Str body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Str body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Str body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad NameLoad attr ListLoad Str Str FunctionDef arguments args defaults body Expr Call NameLoad Assert UnaryOpNot NameLoad BinOpAdd Str Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad Assign NameStore Str Assign NameStore Str If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Print Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Print Str TryExcept body Assign TupleStore NameStore NameStore NameStore Call NameLoad ListLoad NameLoad handlers ExceptHandler body Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad For NameStore SubscriptLoad NameLoad Slice body Expr Call AttributeLoad NameLoad attr Expr Call NameLoad If NameLoad body Raise Call NameLoad Str Print Str decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A 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.
 N/A os N/A sys N/A gc N/A __all__ N/A popen2 popen3 popen4 N/A N/A N/A MAXFD N/A N/A os sysconf SC_OPEN_MAX N/A N/A N/A N/A AttributeError ValueError N/A N/A MAXFD 256 N/A _active N/A _cleanup N/A N/A N/A N/A N/A inst N/A _active N/A N/A N/A N/A N/A N/A inst poll _deadstate N/A sys maxint 0 N/A N/A N/A N/A N/A N/A _active remove inst N/A N/A N/A ValueError N/A N/A N/A Popen3 N/A N/A N/A Class representing a child process.  Normally instances are created
    by the factory functions popen2() and popen3(). N/A sts -1 __init__ N/A N/A self cmd capturestderr bufsize N/A False -1 N/A N/A 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. N/A N/A _cleanup N/A N/A self cmd cmd N/A N/A p2cread p2cwrite N/A N/A os pipe N/A N/A c2pread c2pwrite N/A N/A os pipe N/A capturestderr N/A N/A N/A errout errin N/A N/A os pipe N/A N/A N/A gc disable_finalizers N/A N/A N/A N/A self pid N/A N/A os fork N/A N/A N/A self pid 0 N/A N/A N/A N/A os dup2 p2cread 0 N/A N/A N/A os dup2 c2pwrite 1 N/A capturestderr N/A N/A N/A N/A os dup2 errin 2 N/A N/A N/A self _run_child cmd N/A N/A N/A N/A gc enable_finalizers N/A N/A N/A os close p2cread N/A N/A self tochild N/A N/A os fdopen p2cwrite w bufsize N/A N/A N/A os close c2pwrite N/A N/A self fromchild N/A N/A os fdopen c2pread r bufsize N/A capturestderr N/A N/A N/A N/A os close errin N/A N/A self childerr N/A N/A os fdopen errout r bufsize N/A N/A N/A self childerr None N/A __del__ N/A N/A self N/A N/A N/A N/A N/A self poll _deadstate N/A sys maxint N/A N/A N/A self sts 0 N/A N/A N/A _active None N/A N/A N/A N/A _active append self N/A _run_child N/A N/A self cmd N/A N/A N/A N/A isinstance cmd basestring N/A N/A cmd N/A /bin/sh -c cmd N/A i N/A xrange 3 MAXFD N/A N/A N/A N/A N/A N/A os close i N/A N/A N/A OSError N/A N/A N/A N/A N/A N/A N/A os execvp N/A cmd N/A 0 cmd N/A N/A N/A N/A os _exit 1 N/A poll N/A N/A self _deadstate N/A None N/A N/A Return the exit status of the child process if it has finished,
        or -1 if it hasn't finished yet. N/A N/A N/A self sts 0 N/A N/A N/A N/A N/A pid sts N/A N/A os waitpid N/A self pid N/A os WNOHANG N/A N/A pid N/A self pid N/A N/A N/A self sts sts N/A N/A N/A N/A os error N/A N/A N/A _deadstate None N/A N/A N/A self sts _deadstate N/A N/A self sts N/A wait N/A N/A self N/A N/A N/A Wait for and return the exit status of the child process. N/A N/A N/A self sts 0 N/A N/A N/A pid sts N/A N/A os waitpid N/A self pid 0 N/A N/A pid N/A self pid N/A N/A self sts sts N/A N/A self sts N/A N/A Popen4 N/A Popen3 N/A N/A childerr None __init__ N/A N/A self cmd bufsize N/A -1 N/A N/A N/A _cleanup N/A N/A self cmd cmd N/A N/A p2cread p2cwrite N/A N/A os pipe N/A N/A c2pread c2pwrite N/A N/A os pipe N/A N/A N/A gc disable_finalizers N/A N/A N/A N/A self pid N/A N/A os fork N/A N/A N/A self pid 0 N/A N/A N/A N/A os dup2 p2cread 0 N/A N/A N/A os dup2 c2pwrite 1 N/A N/A N/A os dup2 c2pwrite 2 N/A N/A N/A self _run_child cmd N/A N/A N/A N/A gc enable_finalizers N/A N/A N/A os close p2cread N/A N/A self tochild N/A N/A os fdopen p2cwrite w bufsize N/A N/A N/A os close c2pwrite N/A N/A self fromchild N/A N/A os fdopen c2pread r bufsize N/A N/A N/A N/A N/A N/A N/A sys platform N/A 3 win N/A N/A sys platform os2emx N/A N/A Popen3 Popen4 popen2 N/A N/A cmd bufsize mode N/A -1 t N/A N/A 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. N/A N/A w r N/A N/A os popen2 cmd mode bufsize N/A N/A r w N/A popen3 N/A N/A cmd bufsize mode N/A -1 t N/A N/A 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. N/A N/A w r e N/A N/A os popen3 cmd mode bufsize N/A N/A r w e N/A popen4 N/A N/A cmd bufsize mode N/A -1 t N/A N/A 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. N/A N/A w r N/A N/A os popen4 cmd mode bufsize N/A N/A r w N/A N/A popen2 N/A N/A cmd bufsize mode N/A -1 t N/A N/A 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. N/A inst N/A Popen3 cmd False bufsize N/A N/A N/A inst fromchild N/A inst tochild N/A popen3 N/A N/A cmd bufsize mode N/A -1 t N/A N/A 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. N/A inst N/A Popen3 cmd True bufsize N/A N/A N/A inst fromchild N/A inst tochild N/A inst childerr N/A popen4 N/A N/A cmd bufsize mode N/A -1 t N/A N/A 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. N/A inst N/A Popen4 cmd bufsize N/A N/A N/A inst fromchild N/A inst tochild N/A N/A N/A N/A __all__ extend N/A Popen3 Popen4 _test N/A N/A N/A N/A N/A N/A _cleanup N/A N/A _active N/A Active pipes when test starts  N/A repr N/A N/A c cmd N/A c _active N/A cmd cat N/A teststr ab cd
 N/A N/A N/A os name nt N/A N/A cmd more N/A expected N/A N/A teststr strip N/A testing popen2... N/A N/A r w N/A popen2 cmd N/A N/A N/A w write teststr N/A N/A N/A w close N/A got N/A N/A r read N/A N/A N/A N/A got strip expected N/A N/A N/A ValueError N/A wrote %r read %r N/A teststr got N/A testing popen3... N/A N/A N/A N/A r w e N/A popen3 N/A cmd N/A N/A N/A N/A N/A r w e N/A popen3 cmd N/A N/A N/A w write teststr N/A N/A N/A w close N/A got N/A N/A r read N/A N/A N/A N/A got strip expected N/A N/A N/A ValueError N/A wrote %r read %r N/A teststr got N/A got N/A N/A e read N/A got N/A N/A N/A ValueError N/A unexpected %r on stderr N/A got N/A inst N/A _active N/A N/A N/A N/A N/A inst wait N/A N/A _cleanup N/A _active N/A N/A N/A ValueError _active not empty N/A All OK N/A N/A N/A __name__ __main__ N/A N/A N/A _test