By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

stdout and threads

P: n/a
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)

using
Python 2.5 (r25:51908
Idle 1.2

tpt

May 28 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On May 28, 4:54 am, "Troels Thomsen" <nej tak ...wrote:
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)

using
Python 2.5 (r25:51908
Idle 1.2

tpt
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.

Mike

May 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.