码迷,mamicode.com
首页 > 编程语言 > 详细

python+requests——URL的编码和解码

时间:2020-02-23 20:19:43      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:count   mic   mamicode   执行   port   test   alt   png   解码   

技术图片

 

 

 

from urllib.parse import  quote,unquote

d = {lang:python,type:testing,ccountry:quote(中国)}

print(d)                                   #执行结果:{‘lang‘: ‘python‘, ‘type‘: ‘testing‘, ‘ccountry‘: ‘%E4%B8%AD%E5%9B%BD‘}

print(unquote(%E4%B8%AD%E5%9B%BD))       #执行结果:中国

 

python+requests——URL的编码和解码

标签:count   mic   mamicode   执行   port   test   alt   png   解码   

原文地址:https://www.cnblogs.com/xiaobaibailongma/p/12353301.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!