python 查找txt文件中的字符串
发布日期:2021-06-24 15:21:08 浏览次数:5 分类:技术文章

本文共 304 字,大约阅读时间需要 1 分钟。

findMusic="BLACKPINK-BOOMBAYAH";MusicLine=0;f = open('musicName12.txt','r',encoding='utf8')for lines in f.readlines():    MusicLine=MusicLine+1;    if lines.find(findMusic)!=-1:        print(lines)        print("find it .........................")        print(MusicLine)    #print(lines,end='')f.close()

在这里插入图片描述

转载地址:https://blog.csdn.net/weixin_33595571/article/details/106701104 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:python 字符串替换 本地地址转换为网络地址
下一篇:python 3 读取文件txt 打印print

发表评论

最新留言

关注你微信了!
[***.104.42.241]2024年04月13日 11时52分27秒