Say there is a file with multiple lines of dictionaries,
{"apple": "red", "oarange": "orange", "pear": "green"}
From this a string is captured, for
>>> input = '"apple": "red", "oarange": "orange", "pear": "green"'
>>> input
'"apple": "red", "oarange": "orange", "pear": "green"'
and, of course, I could easily capture it as
>>> input = '{"apple": "red", "oarange": "orange", "pear": "green"}'
>>> input
'{"apple": "red", "oarange": "orange", "pear": "green"}'
regardless, I wish to take input and make it a new value of a new dictionary, so, using two different methods that don't work,
>>> mydict['plate1'] = input
>>> mydict['plate2'] = {input}
yields the undesirable
>>> mydict
{'test': set(['"user_name": "BO01", "password": "password", "attend_password": "BO001"']), 'plate1': '"apple": "red", "oarange": "orange", "pear": "green"'}
neither of which is the desired
'plate1' : {"apple": "red", "oarange": "orange", "pear": "green"}
anyone know how to take the input string and make it play nicely as a dictionary value for the parent dictionary?