Browse Source

aufgave2 (ying und yang)

master
Nadege 5 years ago
parent
commit
7bd8747737
3 changed files with 37 additions and 0 deletions
  1. 15
    0
      Aufgabe2/httpServer.py
  2. 11
    0
      Aufgabe2/yang.html
  3. 11
    0
      Aufgabe2/ying.html

+ 15
- 0
Aufgabe2/httpServer.py 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
- 0
Aufgabe2/yang.html 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
- 0
Aufgabe2/ying.html 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>

Loading…
Cancel
Save