你代码根本地方错了 刚才我没看清楚
with open('password', 'r', encoding='utf-8') as f:
print(f.readlines())
print(f.readlines())
第二次直接是 []
读文件指针已经移动到底了 所以第二次没内容了啊
with open('password', 'r', encoding='utf-8') as f:
# print(f.readlines())
# print(f.readlines())
readlines = f.readlines()
print(readlines)
for i in readlines:
if i.strip() == 'abc:cba':
break
else:
print('none')
这样就可以了
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…