Reputation:
I want to import thread package in Python 3.6. But this error is occurred:
import thread
ModuleNotFoundError: No module named 'thread'
Upvotes: 7
Views: 15148
Reputation: 11
import threading
def main():
...
if __name__ =="__main__":
t1 = threading.Thread(target=main, args=())
t2 = threading.Thread(target=main, args=())
t1.start()
t2.start()
t1.join()
t2.join()
Upvotes: 1