-
幕布斯7119047
1234while 1==1: print 'Hello'#这里执行不到print 'xxxxxxx'
-
万千封印
你在循环里面 加个 暂停的语句 就可以了import timex=0while True:x=x+1print xtime.sleep(5)
-
陪伴而非守候
1234567def loop(init): now = init while 1: yield now now+=1for i in loop(0): print i
-
RISEBY
import threading##多线程def a:while True:print("hello")def b:print("xxxx")threads=[]t1=threading.Thread(target=self.a())threads.append(t1)t2=threading.Thread(target=self.b())threads.append(t2)for t in threads:t.setDaemon(True)t.start