首页 > 编程语言 > 详细

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

时间:2019-02-05 12:51:34      阅读:210      评论:0      收藏:0      [点我收藏+]
#coding = utf8

import threading,time 

count = 0
class MyThread(threading.Thread):
    def __init__(self,threadName):
        super(MyThread,self).__init__(name = threadName)

    def run(self):
        global count
        for i in range(100):
            count = count + 1
            time.sleep(0.3)
            print(self.getName() , count)

for i in range(2):
    MyThread("MyThreadName:" + str(i)).start()

技术分享图片

 

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

原文:https://www.cnblogs.com/tszr/p/10352656.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!