python -通過yield實現文件的讀取

def bylineread(fimename): with open(fimename) as f: # 打開文件 line = f.readline() # 讀取一行內容 print('----1----') while line: print('-----2----') yield
相關文章
相關標籤/搜索