I working on python based project where formula's are stored in dB. My script will read the formula's from a particular column and stored in list . For Eg
formula[0] = "round(float(latitude[:2]) + (float(latitude[2:]) / 60)"
formula[1] = "round(float(longitude[:3]) + float(longitude[3:]) / 60),6)"
formula[3] = "int(float(speed)*1.852)"
Through TCP socket comma separated values will be coming like
"imei:1234467454545,ac alarm,160302150105,,F,094605.000,A,1301.9905,N,08014.0746,E,0.19,298.01,,0,,,,;"
by coding I have split the comma-separated values and stored in list. From the stream "1301.9905 "
is latitude, "08014.0746"
is longitude and "0.19"
is speed value.
How can I apply the value in the formulas and store in some variable? I have tried this method
latitude = "1301.9905"
latitude = round(float(latitude[:2]) + (float(latitude[2:]) / 60),6)
print latitude