python中string、json、bytes的转换

 

json->string

str = json.dumps(jsonobj)

bytes->string

str = str(bytes,‘utf-8’)

string->json

json = json.loads(str)

 

参考:

https://www.cnblogs.com/xiandedanteng/p/9009964.html

https://www.cnblogs.com/z3286586/p/11038864.html

https://www.cnblogs.com/fqfanqi/p/7900758.html

 

posted @ 2019-07-18 01:02  anobscureretreat  阅读(1148)  评论(0编辑  收藏  举报