python List和String 转换注意

不能用str(list),
t=['x87xe9xa5xb0xefxbc']
In [28]: str(t)
Out[28]: "['\x87\xe9\xa5\xb0\xef\xbc']"

要用‘’.join(list)

In [29]: ''.join(t)
Out[29]: 'x87xe9xa5xb0xefxbc'

原文地址:https://www.cnblogs.com/jsplyy/p/5636475.html