file = open("path(输出文件路径)", 'w', encoding='utf-8')
with open("path(原始文件路径)", "r") as f:
for line in f.readlines():
line = line.strip('\n')
a = []
for i in line:
if i == "。":
i = "。" + "\n"
a.append(i)
strvar = "".join(a)
file.write(strvar)
file = open("path(输出文件路径)", 'w', encoding='utf-8')
with open("path(原始文件路径)", "r") as f:
for line in f.readlines():
line = line.strip('\n')
a = []
for i in line:
if i == "。":
i = "。" + "\n"
a.append(i)
strvar = "".join(a)
file.write(strvar)