【发布时间】:2021-08-12 02:00:26
【问题描述】:
我正在尝试在 python 中读取一个大文件。
with open("some_big_file.txt") as f:
for line in f:
process_lines(line)
但我收到此错误:
NameError: name 'process_lines' 未定义
【问题讨论】:
-
哈哈你的
def process_lines(line)函数/方法在哪里?它与文件的打开无关,但与它的处理有关......
标签: python text with-statement