@zzy0471
2018-04-11T20:41:34.000000Z
字数 246
阅读 929
Python
今天加班没时间写笔记,记录下线程的基本用法如下:
import threading
def do_work():
print('thread:', threading.current_thread().name)
t = threading.Thread(target=do_work, name='child thread')
t.start()
t.join()
print('main thread:', threading.current_thread().name)