passing threading.Thread() and function object

  • Thread starter Christopher J. Bottaro
  • Start date
C

Christopher J. Bottaro

Hello,

I'm new to Python programming, so please excuse me.

thread = threading.Thread(self.somefunc())
thread.start()
print "Thread started"

def somefunc(self):
while (1)
print "In thread"


"Thread started" never gets printed, but "In thread" gets printed
repeatedly. What is going on? It seems like thread.start() is blocking
and effectively running self.somefunc() as a normal function.

Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,088
Members
47,686
Latest member
scamivo

Latest Threads

Top