#!/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输出为ह ै ।
期望的输出是भारत का इतिहास काफी समृद्ध एवं विस्तृत है।
请告诉我我做错了什么?需要帮助!提前谢谢
下面是一个模板:
我不知道你和
word
有什么关系,但我会这样做:相关问题 更多 >
编程相关推荐