python读取中文命名的.py文件

2018-05-22  本文已影响0人  地铁姑娘

python读取中文名的文件一直比较麻烦
目前得到的可靠解决方案:

coding=utf-8

strPath = "类.py" #这里的strpath是你的中文路径名
a = unicode(strPath , "utf-8")
print list(fileinput.input(a))

上一篇 下一篇

猜你喜欢

热点阅读