Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import urllib
- def urlencode(params):
- quote = lambda s: urllib.quote(str(s), safe='~')
- return '&'.join('%s=%s' % (quote(k), quote(params[k])) for k in sorted(params) if params[k])
Add Comment
Please, Sign In to add comment