thread and processes with python/GTK

awalter1 alain.walter at thalesgroup.com
Tue Jan 30 05:07:14 EST 2007


Hello,

I'm developping an application with python, pyGTK and GTK+.
I've performed many tests by using methods as Popen, popen2, 
os.system ... to communicate with Unix (HPUX),
The last attempt is this code written in a thread :
	    fin,fout = popen2.popen2('ps -def')
	    line = fin.readline()
	    while 1 :
	    	if not line : break
	    	print "line=",line
	   	line = fin.readline()
	    fin.close()
In that case, lines are printed only when I exit my application.
Usually the behavior is not as expected and I cannot understand why. I 
am wondering that it could be a constraint from the use of GTK 
(mainloop() existence ???).
Is somebody aware about conflict between GTK use and unix mechanism.

Thanks for you help




More information about the Python-list mailing list