aufgave2 (ying und yang)

This commit is contained in:
Nadege 2019-10-22 15:05:06 +02:00
parent 89d83fe213
commit 7bd8747737
3 changed files with 37 additions and 0 deletions

15
Aufgabe2/httpServer.py Normal file
View File

@ -0,0 +1,15 @@
import http.server
class EingenerHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
if self.path == '/':
self.path = '/ying.html'
msg = open(self.path[1:]).read()
self.wfile.write(bytes(msg, 'utf-8'))
Port = 2020
Handler = EingenerHandler
address = ('', Port)
server = http.server.HTTPServer(address, Handler)
server.serve_forever()

11
Aufgabe2/yang.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Python is awesome!</title>
</head>
<body>
<h1>Yang</h1>
<a href="ying.html" style="font-size: 25px">Ying</a>
</body>
</html>

11
Aufgabe2/ying.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Python is awesome!</title>
</head>
<body>
<h1>Ying</h1>
<a href="yang.html" style="font-size: 25px">Yang</a>
</body>
</html>