摘要:
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 阅读全文
posted @ 2018-01-02 21:22
xiongrongqin123
阅读(598)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2018-01-02 21:17
xiongrongqin123
阅读(382)
评论(0)
推荐(0)
摘要:
dic={'a':1,'b':2,'c':3}iter_dic=dic.__iter__()print(iter_dic.__next__()) #等同于next(iter_dic) 阅读全文
posted @ 2018-01-02 21:04
xiongrongqin123
阅读(141)
评论(0)
推荐(0)

浙公网安备 33010602011771号