摘要:
import timedef tail(filepath): with open(filepath,'rb') as f: f.seek(0,2) while True: line=f.readline() if line: yield line else: time.sleep(0.05)def 阅读全文
摘要:
def my_range(start,stop,step=1): while start < stop: yield start #start=1 start+=step #start=3 g=my_range(1,7,2) print(g) for i in my_range(1,7,2): pr 阅读全文
摘要:
dic={'a':1,'b':2,'c':3}iter_dic=dic.__iter__()print(iter_dic.__next__()) #等同于next(iter_dic) 阅读全文