Sep-13-2018, 11:20 PM
Hello, I use code like this
Now I want to get rid of the temp= and 'C so that I can insert just the number eg, 55.6 to a database. How do I get rid of temp= and 'C?
I tried re.sub("\D", "" cpu_temp2) but it returns 556, How do I preserver the 55.6?
Thanks
cpu_temp2 = os.popen("vcgencmd measure_temp").readline()to get the cpu temperture of the pi.It returns a string temp=55.6'C
Now I want to get rid of the temp= and 'C so that I can insert just the number eg, 55.6 to a database. How do I get rid of temp= and 'C?
I tried re.sub("\D", "" cpu_temp2) but it returns 556, How do I preserver the 55.6?
Thanks