Steve McClure schrieb:

On Wed, 2005-03-23 at 15:27, Marcus Habermehl wrote:
Hi.

I want to write the output of os.popen('command') to a gtk.TextView.

But I don't know how. :(

If I use

for line in os.popen('command').readlines():
    textview.insert_at_cursor(line)

I must wait untils 'command' has finished.

Is there a better way? Is it not possible to wrote the output directly to a gtk.TextView?

I have found some documentation about pipes or related things. But because my english isn't very good I doesn't understand it realy.

Have anyone a hint for me?

Try looking at os.popen3

You can do something like

[example]

That isn't what I want. On your example I must wait until the command in os.popen3 has finished.

If the command need some minutes the user doesn't know what the script doing. And I want that the user can see the output in "real-time".

You know what I mean?

regards
Marcus

__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to