#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
separators = [u"।", u",", u"."]
dat=open(r"C:\Users\User\Desktop\text4.txt",'r').read()
text=dat.decode("utf-8")
wros=text.split()
out=""
import string
space=" "
counter=0;
for word in wros:
out=u" ".join(word)
writ=open("C:\\Users\\User\\Desktop\\text5.txt",'w')
writ.write(out.encode('utf-8'))
writ.close()
text4.txt包含भारतकाइतिहासकाफीसमृद्धधवंविस्तृतहै。 text5.txt输出为है。
期望的输出是भारतकाइतिहासकाफीसमृद्धधवंविस्तृतहै。
请告诉我我在做什么是错的? 需要HElp!提前谢谢