Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language

Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Python Programming Language

stdout and threads

Hello All

I have trouble printing to stdout from a thread and main program.

Not only will it look strange when they try to print at the same time, that
is ok, but i think i see lock-ups. (strange exceptions in Tkinker etc) Or is
it an issue with IDLE ?

Should I implement a lock'ed / queued version and hook it into the
sys.stdout ?

(sorry if this has been answered recently in this group)

Python 2.5 (r25:51908
Idle 1.2


On May 28, 4:54 am, "Troels Thomsen" <nej tak ...> wrote:

I've read in multiple sites/books that running Tkinter from IDLE can
cause screwy errors and I've seen a little bit of that behavior
myself. This website mentions the problem: http://www.ferg.org/thinking_in_tkinter/index.html

>From what I've read in Lutz's book, Programming Python, it sounds like

using the Queue module for messages is a good way to go, using
producer and consumer threads. Then just check the queue from time to
time to grab the messages and print them out, maybe to a separate
text widget.


Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc