python中判断在文件中是否存在某字符串?
a = 'abc' #--------------------要查询的字符串with open('1.txt','r') as foo: for line in foo.readlines(): if a in line: print line
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号