【发布时间】:2013-06-20 03:08:36
【问题描述】:
我正在逐行处理一个文件
for line in mix_files[i]:
if my_string in line:
use the next line # How to get the next line
找到包含文本的行后,我需要处理下一行。有没有简单的方法来获取下一行(例如,增加一个迭代器),而不是不太舒服的方法:
get line number -> increment line number -> use the next line
感谢您的帮助。
【问题讨论】:
标签: python python-3.x iterator line