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

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

coding=utf-8

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

    原文作者:yueyunW
    原文地址: https://www.jianshu.com/p/76773a620ce8
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞