多线程练习

2015-06-05 0 822
多线程练习
import threading
import time
from sys import stdout

class mythread(threading.Thread):
    def __init__(self,threadname):
        threading.Thread.__init__(self, name = threadname)
        
    def run(self):
        for i in range(10):
            print(self.getName(),i)
            time.sleep(1)
            
            
thread1 = mythread('mythread')
thread1.start()

running = threading.currentThread()
time.sleep(5)
for i in range(5):
    stdout.write(str(i)+'\t')

遇见资源网 python 多线程练习 http://www.ox520.com/15426.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务