[PyKDE] exec_loop blocking problem under Windows

Green, Gregory P gregory.p.green at boeing.com
Fri Jun 21 23:20:01 BST 2002


This behaviour is common to all gui libraries, not just PyQt. It is called
"event driven programming". The main gui will just loop, waiting for events
to arrive and then processing them. Most libraries have an "idle event"
which will be executed whenever no other events are waiting. If your task
can be broken down into little chunks that can be processed at random times,
you can do it this way. More commonly, another thread or process is used to
do the processing which then communicates via some IPC mechanism with the
gui thread/process. In python using threads and the Queue module is a good
way to do this. But there are many other ways. So the short answer to your
question, is yes you can do what you are asking, using any version of PyQt,
python, and OS. It may or may not be the best way to do it. If you provide
more information, then we can give a better answer.

-----Original Message-----
From: Tuvi, Selim [mailto:stuvi at SLAC.Stanford.EDU]
Sent: Friday, June 21, 2002 2:02 PM
To: 'pykde at mats.gmd.de'
Subject: [PyKDE] exec_loop blocking problem under Windows


Hi all, I am new to Python, QT and PyQt so bear with me please.

I noticed that when running a script when exec_loop is executed the Python
interpreter blocks (ie. doesn't execute the subsequent commands). Is this
the default behaviour on all platforms or is it something specific to
Windows?

What I'd like to have is run exec_loop in a python thread and do other
processing in my script? Is this possible with the current PyQt release? We
are currently using QT 3.0.4 and Python 2.2.1 under Windows 2000.




More information about the PyQt mailing list