2021
03-12
03-12
python读取中文路径时出错(2种解决方案)
编码问题可能导致python读取中文路径时出错解决方法一:路径拆分单独编码importosroot_path='E:\\project\\sk_man-master\\SK\\static\\sk\\new_clothes\\'+u'裤子'forfileinos.listdir(root_path):printfile.decode('gbk')方法二:对全部路径用unicode格式编码root_path=unicode('E:\\project\\sk_man-master\\SK\\static\\sk\\new_clothes\\裤子','utf-8')补充:python读取word路径出错python读取doc文档不方便,所...
继续阅读 >