Advertisement
Guest User

Untitled

a guest
Feb 15th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.65 KB | None | 0 0
  1. from netcreds import *
  2. from nettools import *
  3. import usocket as socket
  4.  
  5. wlan_connect(essid,essid_password)
  6.  
  7. def web_page():
  8.    
  9.    html = """ <!DOCTYPE html>
  10.   <html>
  11.   <head>
  12.    <title>AUTOAGILITY &copy</title>
  13.    <style>
  14.    body {
  15.     background-color: #aaa;
  16.     font-family: arial;
  17. }
  18.  
  19. #container {
  20.     background-color: white;
  21.     width: 950px;
  22.     margin-left: auto;
  23.     margin-right: auto;
  24. }
  25.  
  26. #header {
  27.     background-color: deepskyblue;
  28.     color: white;
  29.     font-size: 90px;
  30.     text-align: center;
  31. }
  32.  
  33. #instruct {
  34.     color: deepskyblue;
  35.     text-align: center;
  36.     font-size: 25px;
  37. }
  38.  
  39. .radio-toolbar input[type="radio"] {
  40.     opacity: 0;
  41.    position: fixed;
  42.    width: 0;
  43. }
  44.  
  45. .radio-toolbar label {
  46.    display: block;
  47.    background-color: cornflowerblue;
  48.    padding: 5px 5px;
  49.    text-align: center;
  50.    font-size: 127px;
  51.    border: 5px solid #444;
  52.    border-radius: 30px;
  53.    margin-bottom: 50px;
  54. }
  55.  
  56. .radio-toolbar input[type="radio"]:focus + label {
  57.    border: 5px dashed darkgreen;
  58. }
  59.  
  60. .radio-toolbar input[type="radio"]:checked + label {
  61.    background-color: #bfb;
  62.    border-color: #4c4;
  63. }
  64.  
  65. #explain {
  66.     color: blue;
  67.     font-size: 20px;
  68.     text-align: center;
  69.     margin: 0;
  70. }
  71. #footer {
  72.     padding: 15px;
  73.     background-color: deepskyblue;
  74.     font-size: 30px;
  75.     color: white;
  76.     text-align: center;
  77. }
  78.    </style>
  79.   </head>
  80.   <body>
  81.    <div id="container">
  82.        <div id="header">
  83.            <h2>AUTOAGILITY</h2>    
  84.        </div>
  85.        <div id= "instruct">
  86.            <p>PRESS A BUTTON TO SET THE HEIGHT</p>
  87.        </div>
  88.        <div class="radio-toolbar">
  89.            <input type="radio" id="five" name="height" value="5">
  90.            <label for="five">500</label>  </br>
  91.            <input type="radio" id="four" name="height" value="4">
  92.            <label for="four">400</label> </br>
  93.            <input type="radio" id="three" name="height" value="3">
  94.            <label for="three">300</label> </br>
  95.            <input type="radio"id="two" name="height" value="2">
  96.            <label for="two">200</label> </br>
  97.            <input type="radio" id="one" name="height" value="1" checked>
  98.            <label for="one">100</label>
  99.            <p></p>
  100.        </div>
  101.        <div id="footer">
  102.                Copyright &copy; 2019 Autoagility
  103.        </div>
  104.    </div>
  105.  
  106.   </body>
  107.   </html>"""
  108.    return html
  109.  
  110. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  111. s.bind(('', 80))
  112. s.listen(5)
  113.  
  114. while True:
  115.   conn, addr = s.accept()
  116.   print('Got a connection from %s' % str(addr))
  117.   request = conn.recv(1024)
  118.   print('Content = %s' % str(request))
  119.   response = web_page()
  120.   conn.send(response)
  121.   conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement