我想在Python 3.6中导入线程包。但是出现了这个错误:
import thread ModuleNotFoundError: No module named 'thread'
46qrfjad1#
将其更改为import threading。
import threading
ktecyv1j2#
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()
2条答案
按热度按时间46qrfjad1#
将其更改为
import threading
。ktecyv1j2#