I have came across this problem a few times and can\'t seem to figure out a simple solution. Say I have a string
string = \"a=0 b=1 c=3\"
I wan
from cgi import parse_qsl text = "a=0 b=1 c=3" dic = dict((k, int(v)) for k, v in parse_qsl(text.replace(' ', '&'))) print dic
prints
{'a': 0, 'c': 3, 'b': 1}