Python Urlencode笔记
2016-11-12 本文已影响0人
nanomko
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# python 3.5.2
from urllib.parse import urlencode, unquote, quote
print(urlencode({"arg1": 1, "arg2": 2}))
print(quote("测试"))
print(unquote("%E6%B5%8B%E8%AF%95"))
# output
arg1=1&arg2=2
%E6%B5%8B%E8%AF%95
测试