# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: <NAME>
# Date:   Fri 04 dec 2020
# virtual environment ecam
import psutil
from pprint import pprint as pprint
from datetime import datetime
from time import sleep

tmp = (psutil.sensors_temperatures(), datetime.now())
pprint(tmp)

tmp[0]['coretemp'][0].current

tmp[1]

log = f'{tmp[1].strftime("%Y-%B-%d %H:%M:%S")} - CPU Temp {tmp[0]["coretemp"][0].current}°c'
print(log)


def log_cpu_tmp():
    tmp = (psutil.sensors_temperatures(), datetime.now())
    return f'{tmp[1].strftime("%Y %B %d %H:%M:%S")} - CPU Temp {tmp[0]["coretemp"][0].current}°c'


for _ in range(10):
    print(log_cpu_tmp())
    sleep(2)



StarcoderdataJupyterScriptsDedupFiltered