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

Passing data between threads

P: n/a
Hi all,

I have a script where I create a thread using the thread module. The
thread runs its course and then calls thread.exit ().

However, I'd like to pass some data back to the parent thread before alling
thread.exit () but I can't figure out how.

Any ideas?

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo no****@mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"It's far too easy to make fun of Microsoft products, but it takes a
real man to make them work, and a god to make them do anything useful"
-- Anonymous
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Erik de Castro Lopo wrote:
However, I'd like to pass some data back to the parent thread before alling
thread.exit () but I can't figure out how.


take a look at the Queue class (e.g. calling thread provides queue as
parameter):
http://docs.python.org/lib/module-Queue.html

greetings
uwe
Jul 18 '05 #2

P: n/a
Uwe Hoffmann wrote:
Erik de Castro Lopo wrote:

thread.exit () but I can't figure out how.


oh you are using the "old thread" module. Try to switch to
the threading module if you are not on a very
old python version ( in this case the module Queue is not available)
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.