如果我有一个有 threading.Thread 的类,我会使用.start()运行新线程
class hello(threading.Thread):
def run():
print "hi"
print "bye"
所以这是一个线程,但是当我想要一个类中的 2 个线程函数时?我怎么做?
因为当你使用.start()时,它会在新线程中使用run函数。
如果我有一个有 threading.Thread 的类,我会使用.start()运行新线程
class hello(threading.Thread):
def run():
print "hi"
print "bye"
所以这是一个线程,但是当我想要一个类中的 2 个线程函数时?我怎么做?
因为当你使用.start()时,它会在新线程中使用run函数。