python3实现url编码/解码

# -*- coding:utf-8 -*-
#__author__ = "林深见鹿海蓝见鲸"


from urllib.parse import unquote,quote

def Unquote():
    url = 'http%3A//123'
    unquote_url = unquote(url)
    print("解码前url",url)
    print("解码后url:",unquote_url)

def Quote():
    url = 'http://123'
    quote_url = quote(url)
    print("编码前url",url)
    print("编码后url:",quote_url)

Unquote()
# Quote()

 

posted @ 2021-09-23 21:16  林深见鹿,海蓝见鲸  阅读(266)  评论(0编辑  收藏  举报