python2.7中文路径

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34447388/article/details/83857981

Python2.7处理中文路径时遇到了些问题

解决方法如下

import os

path='./测试'
upath=unicode(path,'utf-8')
dirs=os.listdir(upath)

猜你喜欢

转载自blog.csdn.net/qq_34447388/article/details/83857981