Guest User

Untitled

a guest
Jun 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import urllib
  4.  
  5. def urlencode(params):
  6. quote = lambda s: urllib.quote(str(s), safe='~')
  7. 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