0

I want to convert a string into dictionary. I've tried eval and literal_eval it doesn't work, since there are no quotes for keys.

str_to_convert = "{rpd.col_A : 'Type B', rpd_dev : 'Other, specify', rpd_form : 'Other'}"

Please note that rpd_dev: 'Other, specify', there is comma within the string which needs to be preserved. How can I achieve this in python?

Ch3steR
  • 20,090
  • 4
  • 28
  • 58
Zakyl
  • 63
  • 5

0 Answers0