Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from netcreds import *
- from nettools import *
- import usocket as socket
- wlan_connect(essid,essid_password)
- def web_page():
- html = """ <!DOCTYPE html>
- <html>
- <head>
- <title>AUTOAGILITY ©</title>
- <style>
- body {
- background-color: #aaa;
- font-family: arial;
- }
- #container {
- background-color: white;
- width: 950px;
- margin-left: auto;
- margin-right: auto;
- }
- #header {
- background-color: deepskyblue;
- color: white;
- font-size: 90px;
- text-align: center;
- }
- #instruct {
- color: deepskyblue;
- text-align: center;
- font-size: 25px;
- }
- .radio-toolbar input[type="radio"] {
- opacity: 0;
- position: fixed;
- width: 0;
- }
- .radio-toolbar label {
- display: block;
- background-color: cornflowerblue;
- padding: 5px 5px;
- text-align: center;
- font-size: 127px;
- border: 5px solid #444;
- border-radius: 30px;
- margin-bottom: 50px;
- }
- .radio-toolbar input[type="radio"]:focus + label {
- border: 5px dashed darkgreen;
- }
- .radio-toolbar input[type="radio"]:checked + label {
- background-color: #bfb;
- border-color: #4c4;
- }
- #explain {
- color: blue;
- font-size: 20px;
- text-align: center;
- margin: 0;
- }
- #footer {
- padding: 15px;
- background-color: deepskyblue;
- font-size: 30px;
- color: white;
- text-align: center;
- }
- </style>
- </head>
- <body>
- <div id="container">
- <div id="header">
- <h2>AUTOAGILITY</h2>
- </div>
- <div id= "instruct">
- <p>PRESS A BUTTON TO SET THE HEIGHT</p>
- </div>
- <div class="radio-toolbar">
- <input type="radio" id="five" name="height" value="5">
- <label for="five">500</label> </br>
- <input type="radio" id="four" name="height" value="4">
- <label for="four">400</label> </br>
- <input type="radio" id="three" name="height" value="3">
- <label for="three">300</label> </br>
- <input type="radio"id="two" name="height" value="2">
- <label for="two">200</label> </br>
- <input type="radio" id="one" name="height" value="1" checked>
- <label for="one">100</label>
- <p></p>
- </div>
- <div id="footer">
- Copyright © 2019 Autoagility
- </div>
- </div>
- </body>
- </html>"""
- return html
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.bind(('', 80))
- s.listen(5)
- while True:
- conn, addr = s.accept()
- print('Got a connection from %s' % str(addr))
- request = conn.recv(1024)
- print('Content = %s' % str(request))
- response = web_page()
- conn.send(response)
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement