read in python guaranteed to return all the data that can ever be returned
(unlike the C library function)?
-D
"Thomas Guettler" <guettli at thomas-guettler.de> wrote in message
news:pan.2004.02.12.16.17.48.957440 at thomas-guettler.de...
def shell_command(cmd):
# There mustnot be output to stdout or stderr
# otherwise an exception is raised
p=popen2.Popen4(cmd) # read stdout and stderr
output=p.fromchild.read()
ret=p.wait()
if ret or output:
raise("Error in shell_command '%s': ret=%s output='%s'" %(
cmd, ret, output))
# There mustnot be output to stdout or stderr
# otherwise an exception is raised
p=popen2.Popen4(cmd) # read stdout and stderr
output=p.fromchild.read()
ret=p.wait()
if ret or output:
raise("Error in shell_command '%s': ret=%s output='%s'" %(
cmd, ret, output))