Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Weather_Station/Weather.py.save.1
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23 lines (16 sloc)
1.16 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from w1thermsensor import W1ThermSensor | |
from flask import Flask | |
app = Flask(__name__) | |
def Temperature(): | |
sensor = W1ThermSensor() | |
temperature = sensor.get_temperature() | |
return temperature | |
def WebpageSet(): | |
W = Open("index.html", "w") | |
W.write("<HTML><head> <meta name="viewport" content="width=device-width, initial-scale=1"><Title> Godiva Weather Station (B5) </Title><!DOCTYPE html><meta name="viewport" content="width=device-width, initial-scale=1"><style>body, html { height: 100%; margin: 0;}.bg { /* The image used */ background-image: url("Godiva.jpg"); /* Full height */ height: 100%; /* Center and scale the image nicely */ background-position: center; background-repeat: no-repeat; background-size: cover;}.centered { position: fixed; top: 50%; left: 50%; margin-top: -50px; margin-left: -40px;}</style></head><body><div class="bg"><H3> <Center> ____________________ </H3><H1> <Center> Godiva Weather Station </H1><H3> <Center> Located in Block 5 </Center> </H3><div class="centered"> <font size=100> <H1> | |
@app.route("/") | |
def index(): | |
return "index.html" | |
if __name__ == '__main__': | |
app.run(threaded=True) |