Deadlocking IDLE under Win32

David Fisher python at rose164.wuh.wustl.edu
Thu Apr 13 07:25:32 EDT 2000


----- Original Message -----
From: "Mark Hammond" <mhammond at skippinet.com.au>


> My guess is that the "print" under IDLE is not thread-safe.  Change the
> program to not print (or to append items to a queue, which the main thread
> then prints) and see if this is the problem.

You are correct sir.  Of course, your guess is a bit more educated that most
<wink>.  I ran into the problem printing from multiple threads in IDLE a
while ago, and just assumed it was something that everybody new about
already.  I'm pretty new to python.

While I'm here, I want to say thanks for win32com.  It totally kicks booty.
I have never done anything with COM before and in the last three days I
wrote a COM server to read data from several meters on a testing maching and
load them real-time into an Excel workbook.  Now the users who can't program
can edit the spreadsheet to change formulas and change how the report looks
on their own.

I still don't understand what's going on when I register the server, or how
the VBA object calls get to python, but I works great.

And while I'm at it, thanks for the win32 threads too.  I needed to change
thread priority, and there the solution was.  Too bad I had already hacked
thread_nt.h to allow me to do the same thing before I thought to check the
newsgroup.  I use your version though.  In case I ever want someone else to
run my code <wink>.

I could go on but you get the point.
David






More information about the Python-list mailing list