I want to run this command from python
/opt/vc/bin/vcgencmd measure_temp
when I run it in python it prints the temperature to the screen and returns 0. When I try to assign it to a variable it assigns 0 too.
>>> import os
>>> os.system('/opt/vc/bin/vcgencmd measure_temp')
temp=42.8'C
0
>>> temp=os.system('/opt/vc/bin/vcgencmd measure_temp')
temp=42.8'C
>>> temp
0
>>>
How can I run this command in python and assign the actual temperature to a variable?