python直接读取中文路径的文件时失败,可做如下处理:
inpath = 'C:\Users\chenjunli\PycharmProjects\mytest1\cc.txt'
uipath = unicode(ipath , "utf8")
然后用"uipath"经过编码后的路径去open()即可:
fin = open(uipath)
python直接读取中文路径的文件时失败,可做如下处理:
inpath = 'C:\Users\chenjunli\PycharmProjects\mytest1\cc.txt'
uipath = unicode(ipath , "utf8")
然后用"uipath"经过编码后的路径去open()即可:
fin = open(uipath)