import codecs
filepath=r"C:\Users\Administrator\Desktop\zy.txt"
file=codecs.open(filepath,"rb","gbk","ignore")#按照指定编码
mylist=file.readlines()#返回一个list,读取到内存
#savefilepath="C:\Users\Administrator\Desktop\zy1.txt"
for line in mylist:
QQlist=line.split('----')
print(QQlist[1])
import codecs
filepath=r"C:\Users\Administrator\Desktop\zy.txt"
file=codecs.open(filepath,"rb","gbk","ignore")#按照指定编码
mylist=file.readlines()#返回一个list,读取到内存
#savefilepath="C:\Users\Administrator\Desktop\zy1.txt"
for line in mylist:
QQlist=line.split('----')
print(QQlist[1])