关于python中的Unicode编码问题
https://www.zhihu.com/question/35584979/answer/274675706
python中字符串有两种形式:
str和Unicode
如果是Unicode,使用print输出就是Unicode的字节形式,需要使用decode转一下才显示正常
另外发现python 中
path = u'.' for main_dir, sub_dir_list, sub_file_list in os.walk(path): print main_dir.decode(encoding='utf-8'),1 #正常显示 print (main_dir.decode(encoding='utf-8'),1)
print函数,带括号和不带括号是不相同了,比较奇怪
纯属记录程序人生,如有差错,欢迎指正,轻喷