python requests.content 返回的unicode转为中文显示

requests.content返回byte中的中文显示unicode码,如:‘\u53eb\u6211’,需进行反编码后得到其对应的汉字。


r.content.decode('unicode-escape')
#如:
f='\u4f18\u8863\u5e93\u4fc3\u9500'  
print f  
print(f.decode('unicode-escape'))  
发布了26 篇原创文章 · 获赞 1 · 访问量 1955

猜你喜欢

转载自blog.csdn.net/jiekaile/article/details/102990014
今日推荐