首页 > 编程语言 > 详细

python 多线程2-线程的创建启动,退出

时间:2016-03-28 15:32:56      阅读:210      评论:0      收藏:0      [点我收藏+]
# encoding: UTF-8
import threading
import time

class MyThread(threading.Thread):
    def run(self):
        for i in range(3):
            time.sleep(1)
            msg = "I‘m "+self.name+‘ @ ‘+str(i)
            print msg
def test():
    for i in range(5):
        t = MyThread()
        t.start()
if __name__ == ‘__main__‘:
    test()

  

python 多线程2-线程的创建启动,退出

原文:http://www.cnblogs.com/linbinqiang/p/5329031.html

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