Newbie Thread question
Aahz Maruch
aahz at panix.com
Mon Dec 11 09:20:21 EST 2000
In article <3A3453BD.B9A54981 at ihug.co.nz>,
Matthew <matthewm at ihug.co.nz> wrote:
>
>I've got thread stuff working by sub-classing threading.Thread, but
>haven't be able to figure out how to use them by calling a runnable
>target. Something like:
>
>dog1 = threading.Thread(None, Dog().bark())
I'm suspecting that you need a little more practice with the Python
class system. The way one would normally do this (assuming that Dog is
the name of your subclass) is like this:
class Dog(threading.Thread):
def run(self):
self.bark()
dog1 = Dog()
dog1.start()
>I checked the faq and a few other places and there seems to little to no
>docs to get one started - any urls i've missed.
Try http://starship.python.net/crew/aahz/
--
--- Aahz (Copyright 2000 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
What if there were no rhetorical questions? --Aahz
More information about the Python-list
mailing list