>>> import ast >>> aar='{"ab":1,"ac":2,"ad":3}' >>> aaxx=ast.literal_eval(aar) >>> aaxx {'ab': 1, 'ac': 2, 'ad': 3} >>>
>>> aar='{"ab":1,"ac":2,"ad":3}' >>> aayy=eval(aar) >>> aayy {'ab': 1, 'ac': 2, 'ad': 3} >>>
标签:aayy,ac,ab,ad,python,aar,字符串,字典 From: https://www.cnblogs.com/xkdn/p/16973755.html