标签:coding open path strip() div 读文件 函数 enc tail
def tail(path): #with open(‘fffs‘,encoding=‘utf-8‘) as f: f = open(path,encoding=‘utf-8‘) while True: line = f.readline() if line.strip(): yield line.strip() g = tail(‘fffs‘) for i in g: print(‘sssss‘,i)
def tail(path): #with open(‘fffs‘,encoding=‘utf-8‘) as f: f = open(path,encoding=‘utf-8‘) while True: line = f.readline() if line.strip(): yield line.strip() g = tail(‘fffs‘) for i in g: print(‘sssss‘,i)
标签:coding open path strip() div 读文件 函数 enc tail
原文地址:https://www.cnblogs.com/limw/p/9692574.html