[pygtk] Non-blocking subprocess.Popen stop GUI
Bou Baris
boubaris at gmail.com
Mon Aug 31 01:18:32 WST 2009
2009/8/30 Bou Baris <boubaris at gmail.com>:
>> Instead of using select() use gobject.io_add_watch() on proc.stdout to
>> register a callback function that is used to read the % and set the progress
>> bar.
>
> I've modified my code to test gobject.io_add_watch()
> I expect that test_io_watch() print in console line readed from proc.stdout
> But i see nothing: look like a blocking behaviour (as when use Popen
> without use select)
> If I stop program with CTRL-C, now I see the output to console/terminal
>
>
> def test_io_watch(self, file, condition):
> print str(file.readline())
> return True
MMhhhh looks that test_io_watch is NEVER called during Popne execution.
It's called only when I type a CTRL-C (stopping 'mkvextract' running
in the background)
Like a blocking fashion ....
More information about the pygtk
mailing list