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 1276 2010-10-04 14:44:39Z sontag $
|
|
SubprocessError
|
|
|
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
|
|
|
|
|
|
|
|
|
subshellRedir(cmd,
shell=None)
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. |
source code
|
|
|
|
_wrapSubprocess(cmdline)
This function is set up mostly for use on Windows (w/out Cygwin)
since that is the only mode it is currently expected to be used in. |
source code
|
|
|
|
|
|
|
OS_HAS_FORK = True
|
|
|
__package__ = 'pyraf'
|
Imports:
errno,
os,
select,
signal,
string,
subprocess,
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.
|