Maurice LING enlightened us with: > So, at the end of run(), what happens to the thread? Just die? Yep. > While I am on it, can threading.Thread.run() accept any parameters? Nope. Pass them to the constructor and remember them. > class myThread(threading.Thread): > def __init__(self, func): > self.func = func > threading.Thread.__init__(self) > def run(self): > print '%s function running' % self.func > self.func() You don't need to do this, since you can pass a callable object to the Thread constructor. Read the first lines of http://docs.python.org/lib/thread-objects.html again. That would change your code to: class myClass: def __init__(self): pass def aFunc(self): pass def bFunc(self): pass def runAll(self): threading.Thread(self.aFunc).start() threading.Thread(self.bFunc).start() Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? Frank Zappa
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4