#coding utf-8
#mojun
import time
def A():
while True:
print('------A------')
yield
time.sleep(5)
def B(g):
while True:
print('-----------B--------------')
g.__next__()
time.sleep(0.5)
if __name__=='__main__':
g=A()
print(g)
B(g)

被折叠的 条评论
为什么被折叠?



