python按行读取

tech2025-08-08  11

 python按行读取存入列表:

def load_file_line(file): buffer = open(file, mode='r') str = buffer.readline() list_file = [] while str != '': list_file.append(str) str = buffer.readline() buffer.close() print(list_file)

 

最新回复(0)