import http.server


class EigenerHandler(http.server.BaseHTTPRequestHandler):

    def do_GET(self):
        self.send_response(200)
        self.send_header('Content-type', 'text-html')
        self.end_headers()
        msg = """
            <html>
                <head>
                    <style>
                    table, th, td {
                    border: 1px solid black;
                    }
                    </style>
                </head>
                    <body>
                        <h2>Quadratzahlen</h2>
                        
                        <form action="http://localhost:12345/" method="get">
                            <div>
                                <label for="von">Von</label>
                                <input name="von" id="von" value="1">
                            </div>
                            <div>
                                <label for="bis">Bis</label>
                                <input name="bis" id="bis" value="5">
                            </div>
                            <div>
                            <button onclick="myFunction()">Eingeben</button>
                            </div>
                        </form>     
                    </body>
            </html>
        """
        self.wfile.write(msg.encode())

port = 12345
Handler = EigenerHandler
address = ('', port)

server = http.server.HTTPServer(address, Handler)
server.serve_forever()