Browse Source

quadrat

master
Mai Gillmann 5 years ago
commit
34854297c5
1 changed files with 52 additions and 0 deletions
  1. 52
    0
      quadrat.py

+ 52
- 0
quadrat.py View File

@@ -0,0 +1,52 @@
import http.server
import urllib.parse

class EigenerHandler(http.server.BaseHTTPRequestHandler):

def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'text-html')
self.end_headers()
#print(self.path)
parsed = urllib.parse.urlparse(self.path)
path = parsed.path
query = parsed.query
query_components = urllib.parse.parse_qsl(query)
for


for k, v in query_components:
msg1 = msg1+ ' ' + k + ': ' + v + '\r\n'

a = "5"

msg = """
<html lang="en">
<style>
table, th, td {
border: 1px solid black;
}
</style>
<head>
<meta charset="UTF-8">
<title>Quadratzahlen</title>
</head>
<body>
<table style>
<tr>
<td>{}</td>
<td>b</td>
</body>
</html>
"""

self.wfile.write(msg1.encode('utf-8'))
self.wfile.write(msg.encode('utf-8'))

port = 12345
address = ('', port)

handler = EigenerHandler
server = http.server.HTTPServer(address, handler)
server.serve_forever()

Loading…
Cancel
Save