|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
signals and thread communication
Hi,
I am writing a graphical interface with Tkinter that prints on a text zone the results of another script that is quite long and tales some time. The problem is that if I use popen4 I don't know when something was written and I only get te results at the end, at that point it is useless to have control text being printed. I would like to use spawn but I don't know how to make two processes communicated (the child process sends a signal to say that he sends something in a pipe, and then the parent process reads the pipe). Could you help me out here, please? If you have any ideas of how to do it differently, I'm open too... thanks, erwin |
|
#2
|
||||
|
||||
|
My preference would be to re-write the results generating script to optionally direct it's output to a socket (UDP) and and have your Tkinter app read the socket on a loop using the after method. That way neither app should lock the other.
I've not used pipes under Linux but I did simulate it with files under Windows - not very nice. ![]() You can still use the popen module (my preference is the popen2.popen4 class as it wraps thing nicely) to launch the results-app and use it to monitor the process id for application termination. grim ![]()
__________________
*** Experimental Python Markup CGI V2 *** Last edited by Grim Archon : June 7th, 2004 at 12:42 PM. |
|
#3
|
|||
|
|||
|
Thanks!
I didn't know about sockets before, it's great! erwin |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > signals and thread communication |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|