Package pyraf :: Module subproc
[hide private]
[frames] | no frames]

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:

$Id: subproc.py 678 2005-07-01 21:19:43Z perry $


Version: Revision: 1.7r

Classes [hide private]
  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
Functions [hide private]
 
record_trial(s)
Exercise encapsulated write/read with an arbitrary string.
source code
 
systemRedir(cmd)
Run the command as a subprocess with Python I/O redirection in effect
source code
 
subshellRedir(cmd, shell=None)
Run the command in a subshell with Python I/O redirection in effect
source code
 
test() source code
Variables [hide private]
  SubprocessError = 'SubprocessError'

Imports: errno, os, select, signal, string, sys, time, types


Function Details [hide private]

record_trial(s)

source code 

Exercise encapsulated write/read with an arbitrary string.

Raise IOError if the string gets distorted through transmission!

systemRedir(cmd)

source code 

Run the command as a subprocess with Python I/O redirection in effect

cmd can be a string or a list of strings.

subshellRedir(cmd, shell=None)

source code 

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.