read variables from text file python code example
Example 1: python read file to variable
with open('data.txt', 'r') as file:
data = file.read().replace('\n', '')
Example 2: how to get variabels from text file
#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.