Skip to content

Instantly share code, notes, and snippets.

@PyYoshi
Created June 17, 2012 03:01
Show Gist options
  • Select an option

  • Save PyYoshi/2943263 to your computer and use it in GitHub Desktop.

Select an option

Save PyYoshi/2943263 to your computer and use it in GitHub Desktop.
urlencodeされたqueryを連想配列に戻す関数 ref: http://qiita.com/items/115d1f3bff23bafb36a2
# coding:utf8
import urllib
def urldecode(s):
rdic = {}
for item in s.split('&'):
keyVal = item.split('=')
rdic[urllib.unquote_plus(keyVal[0])] = urllib.unquote_plus(keyVal[1])
return rdic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment