python直接读取中文路径的文件时失败,可做如下处理:
inpath = 'D:/work/yuanxx/在线导航/驾车导航/walk_log/20130619_172355.txt'
uipath = unicode(ipath , "utf8")
然后用"uipath"经过编码后的路径去open()即可:
fin = open(uipath)
2024-01-26 08:30:34
python直接读取中文路径的文件时失败,可做如下处理:
inpath = 'D:/work/yuanxx/在线导航/驾车导航/walk_log/20130619_172355.txt'
uipath = unicode(ipath , "utf8")
然后用"uipath"经过编码后的路径去open()即可:
fin = open(uipath)
下一篇:python中冒泡排序代码实现