import threading class prthread(threading.Thread):     def __init__(self,thid,thname,s):         threading.Thread.__init__(self)         self.thid = thid         self.thname = thname         self.s = s     def run(self):         # print('start'+self.thname)         pr(self.thname,self.s) def pr(tname,s):     for i in range(s,s+5):         print('%s:%d'%(tname,i)) for i in range(1,75,15):     th1 = prthread(1,'th1',i)     if i < 70 :         th2 = prthread(2,'th2',i+5)     if i < 65 :         th3 = prthread(3,'th3',i+10)     th1.start()     th2.start()     th3.start() 大概就是这么实现的吧..0.0
点赞 1

相关推荐

点赞 评论 收藏
分享
牛客nb666号:见天才的门槛罢了查看图片
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务