[PyKDE] Keeping the GUI from freezing

Paul Giannaros ceruleanblaze at gmail.com
Tue Feb 13 18:19:46 GMT 2007


On Tuesday 13 February 2007 18:12, Tony Cappellini wrote:
> My Gui is calling another Python script which is doing a lot of file I/O.
> Because of this the GUI freezes until that app returns.
>
> I've called that app using a python thread, but I still need a way to
> refresh the GUI so it doesn't hang.
>
> I've looked at the QAssistant API for QThreads, but I don't see what
> I'm looking for, so I'm probably in the wrong place.
>
> The Python examples which use threads (threads\semaphores.py,
> threads\waitconditions.py) don't show how to refresh a GUI or keep it
> from hanging.
>
> Does anyone have a Python example of how to use a Thread to keep a gui
> from becoming unresponsive?

Well, before you turn to threads I'd suggest that there are far simpler ways 
to go about what you want to do. There are may ways to start a process 
asynchronously so that the GUI remains responsive as usual. You can use the 
os.popen function, for example; or the subprocess module; or Qt's QProcess.

>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde




More information about the PyQt mailing list