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>
- <link rel="stylesheet" type="text/css" href="style.css">
- </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)
- request = str(request)
- print('Content = %s' % request)
- response = web_page()
- conn.send('HTTP/1.1 200 OK\n')
- conn.send('Content-Type: text/html\n')
- conn.send('Connection: close\n\n')
- conn.sendall(response)
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement