Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dfbed4b

Browse files
added cpu tempearture script
1 parent ed2bbcc commit dfbed4b

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

‎cpu tempearture/Readme.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Package/Script Name
2+
3+
This python script is used to get cpu temperature
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+
8+
## Detailed explanation of script, if needed
9+
10+
- install psutil using( pip install psutil)
11+
- Use inbuilt function "sensors_temperatures()" to measure temperature of CPU
12+
13+
## Setup instructions
14+
15+
- Clone the repo to your machine
16+
- head over to the required(Cpu Temperature folder)
17+
- run the script(python temp.py)
18+
19+
## Output
20+
21+
<img src="https://raw.githubusercontent.com/gavinlyonsrepo/raspberrypi_tempmon/master/screenshots/main_screen.jpg">
22+
23+
## Disclaimers, if any
24+
25+
This does not work on a windows machine

‎cpu tempearture/temp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# importing the psutil library
2+
import psutil
3+
4+
# Note: It is not for windows user
5+
6+
data = psutil.sensors_temperatures()
7+
print("Current Temperature of CPU (celcius): ",data['coretemp'][0][1])

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /