Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- import time
- while True:
- args = ['cat', '/sys/class/thermal/thermal_zone0/temp']
- try:
- res = subprocess.Popen(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
- except:
- print("Error.")
- output = res.communicate()
- tempature = int(output[0]) / 1000.0
- print('cpu tempature = {0:.4f}℃'.format(tempature))
- time.sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement