代码child=os.path.join('%s/%s'%(filepath,childDir))print(child.decode('gbk'))# .decode('gbk')是解决中文显示乱码问题报错提示line 7, in readFileprint(child.decode())# .decode(‘gbk’)是解决中文显示乱码问题AttributeError: ‘str’ object has no attribute ‘decode’原因python3里面,字符串要先enc
代码child=os.path.join('%s/%s'%(filepath,childDir))print(child.decode('gbk'))# .decode('gbk')是解决中文显示乱码问题报错提示line 7, in readFileprint(child.decode())# .decode(‘gbk’)是解决中文显示乱码问题AttributeError: ‘str’ object has no attribute ‘decode’原因python3里面,字符串要先enc