Like mentioned in comments, there's a module threading that seems to exactly fit your task. Example:
import threading
class A(object):
def __init__(self):
threading.Thread(target=self.task).start()
def task(self):
print 'Hello from a Thread'
a = A()
# output: 'Hello from a Thread'
No comments:
Post a Comment