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 = """
Hier ist "Ying"
Wo ist "Yang"?
"""
else:
msg = """
Hier ist "Yang"
Wo ist "Ying"?
"""
self.wfile.write(msg.encode('utf-8'))
port = 12345
address = ('', port)
handler = EigenerHandler
server = http.server.HTTPServer(address, handler)
server.serve_forever()