Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import time
- from pathlib import Path
- import os
- temp_file = Path('/sys/class/thermal/thermal_zone0/temp')
- while True:
- time.sleep(0.1)
- temp = int(temp_file.read_text()) / 1000
- x, y = os.get_terminal_size()
- temp = '{:.1f} °C'.format(temp)
- y //= 2
- print('\033[2J\033[H')
- print('\n' * y, end='')
- print(str(temp).center(x))
Add Comment
Please, Sign In to add comment