5 回答

陪伴而非守候
TA貢獻1757條經驗 獲得超8個贊
1 2 3 4 5 6 7 | def loop(init): now = init while 1: yield now now+=1 for i in loop(0): print i |

RISEBY
TA貢獻1856條經驗 獲得超5個贊
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
添加回答
舉報
0/150
提交
取消