|
发表于 2020-1-10 14:16:33
|
显示全部楼层
本帖最后由 jackz007 于 2020-1-10 14:22 编辑
- list0 = [ ('李白' , '床前明月光') , ('李清照','鱼C论坛') , ('GDSMAD02154','0123548')]
- list0_utf_8 = [(x[0] . encode('UTF-8') , x[1] . encode('UTF-8')) for x in list0]
- list0 = [(x[0] . decode('UTF-8' , 'strict') , x[1] . decode('UTF-8' , 'strict')) for x in list0_utf_8]
复制代码
你的代码:
- # encoding : utf-8
- list0 = [('李白','床前明月光') , ('李清照','鱼C论坛') , ('GDSMAD02154','0123548')]
- list1 = [(x[0] . decode('UTF-8' , 'strict') , x[1] . decode('UTF-8' , 'strict')) for x in list0]
- print(list1)
复制代码 |
|