I have strings which look like this one:
\"(8, 12.25), (13, 15), (16.75, 18.5)\"
and I would like to convert each of them into a python dat
def parse(s): tuples = s.split('), ') out = [] for x in tuples: a,b = x.strip('()').split(', ') out.append((float(a),float(b))) return out
this should do the job.