2020年12月1日

python查找文件中某个字符串出现的次数

摘要: '''查找文件中某个字符串总共出现的次数'''def findStr(str): with open("filePath",'r') as f: counts = 0 for line in f.readlines(): time = line.count(str) counts += time p 阅读全文

posted @ 2020-12-01 18:41 小白在此 阅读(6107) 评论(0) 推荐(0) 编辑

导航