I have a string in the form of:
s = \'A - 13, B - 14, C - 29, M - 99\'
and so on (the length varies). What is the easiest way to create a d
>>> dict((k.strip(),int(v.strip())) for k,v in (p.split('-') for p in s.split(','))) {'A': 13, 'B': 14, 'M': 99, 'C': 29}