Best way to retrieve variable values from a text file - Python - Json
Referring on this question , I have a similar -but not the same- problem.. On my way, I'll have some text file, structured like: var_a: 'home' var_b: 'car' var_c: 15.5 And I need that python read the file and then create a variable named var_a with value 'home', and so on. Example: #python stuff over here getVarFromFile(filename) #this is the function that im looking for print var_b #output: car, as string print var_c #output 15.5, as number. Is this possible, I mean, even keep the var type? Notice that I have the full freedom to the text file structure, I can use the format I like if the one