os.exec?

deadmeat root at [127.0.0.1]
Mon Dec 25 02:21:03 EST 2000


> Quite possibly, you'd want os.system, and os.popen.
> Or, you might want to work on a lower level with os.fork/os.exec/os.open.

I just figured out how to do this:

   child = os.popen(thecommand)
   while 1:
      line = child.readline()
      if not line:
         break
      sys.stdout.write(line)

which seems to work OK, so unless anyone has any better suggestions I'll go
with this..






More information about the Python-list mailing list