A simple Python script for monitoring CPU temperature on Windows using the wmi library.
The program reads temperature values in real time and displays the current values, maximum, and average temperature.
-
Reads CPU temperature from Windows sensors
-
Converts values from Kelvin to Celsius (°C)
-
Displays:
- All available temperature readings
- Maximum temperature (Max)
- Average temperature (Avg)
-
Auto refresh every 2 seconds
-
Safe exit using
Ctrl + C
- Operating System: Windows only
- Python 3.8 or newer
wmilibrary
pip install wmiThis script must be run as Administrator to access hardware temperature sensors.
- Right-click on Command Prompt or PowerShell
- Select Run as administrator
- Navigate to the script location and run it
-
Save the script as:
cpu_temp_monitor.py -
Run the script:
python cpu_temp_monitor.py
-
CPU temperature will be displayed every 2 seconds
-
Stop the program with:
Ctrl + C
CPU Temperatures (°C): [45.2, 47.0] | Max: 47.0 | Avg: 46.1
- Some systems do not expose CPU temperature via WMI
- Values may represent general thermal zones, not exact CPU core temperatures
- Accuracy depends on motherboard and BIOS support
- Temperature warning when exceeding a threshold (e.g. 80°C)
- Save readings to a CSV file
- Plot temperature graphs 📊
- Add a GUI interface
- Integrate with OpenHardwareMonitor for more accurate data
This project is open-source and intended for educational and monitoring purposes.
✨ Created for learning and system monitoring