Python ast 함수 사용 흰곰곰 2019. 10. 9. 21:43 2019-08-08-python_ast_convert변환하기 String을 dict or list로 변환ximport aststr_dict = "{'a': 3, 'b': 5}"print (type(str_dict)) # <type 'str'>convert_dict = ast.literal_eval(str_dict)print (type(convert_dict)) # <type 'dict'>print (convert_dict['a']) # 3