Am Dienstag, den 19.10.2004, 08:36 -0400 schrieb Steve McClure: > On Mon, 2004-10-18 at 13:05, Marcus Habermehl wrote: > > Am Sonntag, den 17.10.2004, 16:36 -0500 schrieb Skip Montanaro: > > > Marcus> I want to execute some shell commands in my python script. The > > > Marcus> output should be redirected to a gtk.TextView in real-time. How > > > Marcus> can I do this? > > > > > > Use os.popen or one of its cousins, capture the output via reads on the file > > > object returned, then stuff it into the TextBuffer associated with your > > > TextView widget. > > > > That I've making, now. But the text gets insert when the shell command > > is finished. > > > > Is there are not another possibility? > > Make sure the GUI is updated by flushing out all the events after every > line of output. See > http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq23.020.htp
Do you mean while gtk.events_pending(): gtk.main_iteration() If yes I already use it. > Or put the popen into its own thread? Either I makes it wrong or it doesn't work. Now I use this for my script. while gtk.events_pending(): gtk.main_iteration() for item in os.popen('/sbin/removepkg '+eintrag).readlines(): while gtk.events_pending(): gtk.main_iteration() textbuffer2.insert_at_cursor(item) It isn't what I want. But it's an alternative. regards Marcus _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/