|
1 | 1 | # CPU Temperature
|
2 | 2 |
|
3 | | -This python script is used to get cpu temperature |
| 3 | +This Python script is used to retrieve the CPU temperature using the psutil library. |
4 | 4 |
|
5 | | -- psutil (process and system utilities) is a cross-platform library. |
6 | | -- It is used for retrieving information on running processes and system utilization (CPU, memory, disks, network, sensors) in Python. |
7 | 5 |
|
8 | | -## Explanation of the script |
| 6 | +## Prerequisites |
| 7 | +- Python installed on your machine |
| 8 | +- `psutil` library installed. You can install it by running the following command: |
| 9 | + ```bash |
| 10 | + pip install psutil |
9 | 11 |
|
10 | | -- Using psutil library's inbuilt function "sensors_temperatures()" to measure temperature of CPU |
11 | 12 |
|
12 | | -## Setup instructions |
| 13 | +## Explanation of the Script |
13 | 14 |
|
14 | | -- Clone the repo to your machine |
15 | | -- Head over to the required folder (Cpu Temperature folder) |
16 | | -- Install psutil using |
| 15 | +The script utilizes the `psutil` library's `sensors_temperatures()` function to measure the temperature of the CPU. |
| 16 | + |
| 17 | +## Setup Instructions |
| 18 | + |
| 19 | +1. Clone the repository to your local machine. |
| 20 | +2. Navigate to the "Cpu Temperature" folder. |
| 21 | +3. Install the `psutil` library if you haven't already by running the following command: |
17 | 22 | ```bash
|
18 | 23 | pip install psutil
|
19 | 24 | ```
|
20 | | -- Run the script |
21 | | -```bash |
22 | | -python temp.py |
23 | | -``` |
24 | | - |
25 | 25 | ## Output
|
26 | 26 |
|
27 | | -<img src="https://raw.githubusercontent.com/gavinlyonsrepo/raspberrypi_tempmon/master/screenshots/main_screen.jpg"> |
| 27 | +The script will display the current CPU temperature in Celsius. |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +## Compatibility |
| 32 | + |
| 33 | +Please note that the script is primarily designed for Linux-based systems. While it may work on other platforms, the availability and format of temperature information can vary. Ensure that your system supports the `psutil` library and has the necessary sensors for CPU temperature measurement. |
| 34 | + |
| 35 | +## Contributing |
| 36 | + |
| 37 | +Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. |
28 | 38 |
|
29 | | -## Disclaimer |
30 | 39 |
|
31 | | -This does not work on a windows machine |
|
0 commit comments