上图是代码,‘发现一个匹配’,并break之后,for line3 in g3.readlines():就再也不执行了。搜索相关问题,有回答说迭代有次数限制的,请教Python大神解答。X_X 下图是运行结果
ringa_lee2017-04-17 17:42:35
This way of writing is so strange. Does the file pointer need to be reset?
To open two files, you can do this
with open("1.txt") as IN1, open("2.txt") as IN2:
阿神2017-04-17 17:42:35
Problem solved The second for in failed to read g3 in a loop
https://www.zhihu.com/question/45370193?from=profile_question_card