Python convert string object into dictionary

前端 未结 4 1336
太阳男子
太阳男子 2021-01-14 21:48

I have been working to build a complex data structure which would return a dictionary. Currently that class return string object of the form

{
   cset : x,           


        
4条回答
  •  醉梦人生
    2021-01-14 21:59

    If you are careful enough to keep the code valid python, you could use eval:

    eval(yourlongstring)
    

提交回复
热议问题