Browse Source

ying yang

master
Mai Gillmann 5 years ago
commit
d8f1dedb18
1 changed files with 41 additions and 0 deletions
  1. 41
    0
      Ying_Yang

+ 41
- 0
Ying_Yang View File

@@ -0,0 +1,41 @@
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()
print(self.path)
if self.path=="/ying":
msg = """
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hier ist "Ying"</title>
</head>
<body>
<a href="/yang"> Wo ist "Yang"? </a>
</body>
</html>
"""
else:
msg = """
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hier ist "Yang"</title>
</head>
<body>
<a href="/ying"> Wo ist "Ying"? </a>
</body>
</html>
"""
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