Browse Source

aufgabe2

master
parent
commit
06a03d6f1b
1 changed files with 42 additions and 0 deletions
  1. 42
    0
      yindundyang.py

+ 42
- 0
yindundyang.py View File

@@ -0,0 +1,42 @@
import http.server

class EigenerHandler(http.server.BaseHTTPRequestHandler):

def do_GET(self):
self.send_response(200)
self.end_headers()
if self.path == "/ying":
msg = """
<html>
<head>
<title>Titel der Seite </title>
</head>
<body>
<a href="/yang">yang</a>
<h1>ying</h1>
</body>
</html>
"""
else:
msg = """
<html>
<head>
<title> Titel der Seite </title>
</head>
<body>
<a href="/ying">ying</a>
<h1> yang</h1>
</body>

</html>

"""

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


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

Loading…
Cancel
Save