Advertisement
swaggboi

montemp

Feb 28th, 2020
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. import os
  4. import time
  5.  
  6. def measure_temp():
  7.         temp = os.popen("vcgencmd measure_temp").readline() # just runs a shell command
  8.         return (temp.replace("temp=",""))
  9.  
  10. while True:
  11.         print(measure_temp())
  12.         time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement