alphakilo11 / python Goto Github PK
View Code? Open in Web Editor NEWTesting Python Code
Testing Python Code
intented for use on computers that run while I'm away.
Use this:
import os
import smtplib
import time
# Set the temperature threshold (in degrees Celsius)
threshold = 70
# Set the email credentials
username = "[email protected]"
password = "your_email_password"
# Set the recipient's email address
recipient = "[email protected]"
# Set the email subject and message
subject = "High CPU Temperature Alert"
message = "The CPU temperature is currently above the threshold of {} degrees Celsius.".format(threshold)
while True:
# Get the current CPU temperature
temp = os.popen("vcgencmd measure_temp").readline()
# Extract the temperature value from the output
temp = float(temp.replace("temp=", "").replace("'C\n", ""))
# Check if the temperature exceeds the threshold
if temp > threshold:
# Send the email
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(username, password)
server.sendmail(username, recipient, "Subject: {}\n\n{}".format(subject, message))
server.quit()
print("An email has been sent to {}".format(recipient))
# Wait 10 seconds before checking the temperature again
time.sleep(10)
and that:
import wmi
w = wmi.WMI(namespace="root\OpenHardwareMonitor")
temperature_infos = w.Sensor()
for sensor in temperature_infos:
if sensor.SensorType==u'Temperature':
print(sensor.Name)
print(sensor.Value)
Line 30 in 16f8561
open exec
I want a possibility to explore and experience MTG sets by playing with as many differnt cards a set as possible against the Forge AI.
https://github.com/MagicTheGathering/mtg-sdk-python
https://docs.magicthegathering.io
https://github.com/alphakilo11/Python/blob/main/Magic_the_Gathering.ipynb
eg to add the decode code at the beginning of a data file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.