Module subproc
source code
Run a subprocess and communicate with it via stdin, stdout, and
stderr.
Requires that platform supports, eg, posix-style os.pipe and
os.fork.
Subprocess class features:
-
provides non-blocking stdin and stderr reads
-
provides subprocess stop and continue, kill-on-deletion
-
provides detection of subprocess startup failure
-
Subprocess objects have nice, informative string rep (as every good
object ought).
-
RecordFile class provides record-oriented IO for file-like stream
objects.
$Id: subproc.py 678 2005-07-01 21:19:43Z perry $
|
|
Subprocess
Run and communicate asynchronously with a subprocess.
|
|
|
ReadBuf
Output buffer for non-blocking reads on selectable files like pipes
and sockets.
|
|
|
RecordFile
Encapsulate stream object for record-oriented IO.
|
|
|
Ph
Convenient interface to CCSO 'ph' nameserver subprocess.
|
|
|
RedirProcess
Run a system command with I/O redirected using sys.stdin/out/err
|
|
|
SubprocessError = 'SubprocessError'
|
Imports:
errno,
os,
select,
signal,
string,
sys,
time,
types
|
Exercise encapsulated write/read with an arbitrary string.
Raise IOError if the string gets distorted through transmission!
|
|
Run the command as a subprocess with Python I/O redirection in
effect
cmd can be a string or a list of strings.
|
|
Run the command in a subshell with Python I/O redirection in
effect
cmd should be a simple string with the command and its arguments.
shell is the shell to use -- default is value of SHELL environment
variable or /bin/sh if SHELL is not defined.
|