码迷,mamicode.com
首页 > 编程语言 > 详细

吴裕雄 python深度学习与实践(3)

时间:2019-02-05 14:18:38      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:import   tin   9.png   wait   python   imp   print   sleep   bsp   

import threading, time

def doWaiting():
    print(‘start waiting:‘, time.strftime(‘%S‘))
    time.sleep(3)
    print(‘stop waiting‘, time.strftime(‘%S‘))
thread1 = threading.Thread(target = doWaiting)
thread1.start()
time.sleep(1)  #确保线程thread1已经启动
print(‘start join‘)
thread1.join() #将一直堵塞,直到thread1运行结束。
print(‘end join‘)

技术图片

 

吴裕雄 python深度学习与实践(3)

标签:import   tin   9.png   wait   python   imp   print   sleep   bsp   

原文地址:https://www.cnblogs.com/tszr/p/10352674.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!