python面试整理
Python基础文件操作1.有一个jsonline格式的文件file.txt大小约为10Kdef get_lines(): with open('file.txt','rb') as f: return f.readlines()if __name__ == '__main__': for e in get_lines(): process(e) # 处理每一行数据 def get_lines(): with open('file.txt','rb') as f:
原创
2020-09-23 15:06:55 ·
3463 阅读 ·
0 评论