Threading from a class
python at mrabarnett.plus.com
Sun Oct 18 03:27:35 CEST 2009
Someone Something wrote:
> On Sat, Oct 17, 2009 at 4:26 PM, Someone Something <fordhaivat at gmail.com
> <mailto:fordhaivat at gmail.com>> wrote:
> I'm trying to write a IRC client that has to have a method inside
> class Client that has to start a new thread that goes to run() which
> is in the same class. I'm not really understanding all the threading
> tutorials i've found. Can someone help?
> p.s. trying to use the threading module, not the thread module.
# Written for Python v2.6
print "starting thread"
self.thread = threading.Thread(target=self.run)
print "sleeping for 6 seconds"
print "woken up"
for i in range(5):
c = Client()
More information about the Python-list