Giter Club home page Giter Club logo

python's People

Contributors

alphakilo11 avatar

Watchers

 avatar

python's Issues

Create an automatic temperature alert

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)

strip the temp logger

  • remove useless chars
  • switch to byte-storage? (4 Byte for timestamp and 2 Byte for temperature (as the DS18B20 uses 12 bit for temperature this would require a separate code/decode step) would save ~60% space)

Magic the Gathering Assistant

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.

  • Auto-create Forge-readable Decklists for whole Sets
  • Auto-create Decklists of ca. 36 non-land cards
  • Randomize the 36 cards (as they are currently ordered by color)
  • Auto-create Decklists with proper manabase (use vintage or commander-inspired manabase without artifacts?)

Ressources

https://github.com/MagicTheGathering/mtg-sdk-python
https://docs.magicthegathering.io
https://github.com/alphakilo11/Python/blob/main/Magic_the_Gathering.ipynb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.