python response slow when running external DLL

Laura Creighton lac at openend.se
Sat Nov 28 05:51:55 EST 2015


In a message of Sat, 28 Nov 2015 11:13:38 +0100, Peter Otten writes:
>jfong at ms4.hinet.net wrote:
>> Using thread is obviously more logical. I think my mistake was the "while
>> busy:  pass" loop which makes no sense because it blocks the main thread,
>> just as the time.sleep() does. That's why in your link (and Laura's too)
>> the widget.after() scheduling was used for this purpose.

I never saw the reply that Peter is replying to.
The threading module constructs a higher level interface on top of the
low level thread module.  Thus it is the preferred way to go for
standard Python code -- and even Fredrik's recipe contains the
line:
	import thread # should use the threading module instead!

Laura




More information about the Python-list mailing list