python json.loads 得到的是unicode对象【垃圾python】

一般来说使用json.loads(str)可以得到一个dict,但是不知道为啥一直得到的是unicode对象,在terminal中就可以得到dict。

垃圾python,垃圾python,垃圾python

解决方法:

tmp = json.loads(json.loads(tt.encode('utf-8')).encode('utf-8'))

猜你喜欢

转载自www.cnblogs.com/oldBook/p/12957257.html