Python: str > dict

  import ast

sd = "{'a': 10, 'b': 20}"

type(sd)     # str

d = ast.literal_eval(sd)

type(d)      # dict

Comentários