See module documentation for "commands."
At least under UNIX:

  import commands

  status, output = commands.getstatusoutput("ls /tmp")
  print "Command exits with status:", status
  print "Output of command:", output

You only get one stream of output, so play redirection games
with your command if you need to.

This runs the command and doesn't return until it has
completed. If you want interactive scrolling of output,
look at the code for commands, as it is written in python.
You'll be able to run in a separate thread and read lines
of output from a pipe. The code makes a good example.

--Scott

LF11 wrote:
> 
> How can I capture STDOUT and STDERR so as to display the messages inside
> a GtkText?
> 
> Thanks,
> 
>  Chris
> 
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to