[pygtk] Problem with pygtk, threads, an interactive interpreter and os.system()

Gustavo J. A. M. Carneiro gjc at inescporto.pt
Wed Aug 18 06:59:00 WST 2004


A Ter, 2004-08-17 às 18:06, Fernando Perez escreveu:

> The attached code works fairly well for most purposes, but I'm having problems 
> with certain calls made by os.system(), specifically to gv (under Linux, 
> Fedora Core 2 at the moment).  If I call os.system('gv foo.eps &'), gv seems 
> to open fine, but after about 30 seconds of fiddling with it, especially if I 
> open zoom sub-windows, the gv GUI just hangs.  The process becomes completely 
> unresponsive, and the only way to kill it (and the gs children it spawns) is 
> via a manual kill -9.  The weird thing is that I've tried opening other 
> programs, including ggv on the same eps file (and xcalc, konqueror, etc), and 
> nothing else seems to show this behavior.

  os.system, especially with & at the end of the command, is evil.  You
should use one of the os.spawn functions instead.  Regardless on whether
it fixes your problem or not.. :-)

  BTW, when gv blocks does the ipython shell block too, or just gv? 
Does this have anything to do with pygtk at all?

  Regards.

-- 
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic



More information about the pygtk mailing list