摘要: from threading import Thread,current_thread import time def task(): print('%s is running' % current_thread().name) time.sleep(3) print('%s is done' % 阅读全文
posted @ 2018-07-13 16:49 Roc_Atlantis 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 方式一:导入Thread模块 from threading import Thread import time def task(name): print('%s is running' %name) time.sleep(3) if __name__ == '__main__': t=Thread 阅读全文
posted @ 2018-07-13 15:05 Roc_Atlantis 阅读(213) 评论(0) 推荐(0) 编辑