import re
import time
newtime = time.strftime("%Y%m%d%H%M%S", time.localtime(time.time()))
file1 = open(r'..\data\朗文双解清洗'+str(newtime)+'.csv', 'a',encoding='utf-8')
with open(r'..\data\朗文双解.txt',encoding='utf-8') as file:
    conten = file.readlines()
    for lin in conten:
        word=re.findall(r'[123459789]\..*', lin)
        en = re.findall(r'★.*', lin)
        print(en,word)
        gg = str(en)+'\n'+str(word) +'\n'
        file1.write(gg)

标签: 清洗朗文, 朗文词典

添加新评论