123456789101112131415161718192021 |
- import http.server
-
- class EigenerHandler(http.server.BaseHTTPRequestHandler):
-
- def do_GET(self):
- self.send_response(200)
- self.end_headers()
- if(self.path == "/Yang.htlm"):
- with open("Yang.html", "r") as f:
- msg = f.read()
- else:
- with open("Ying.html", "r") as f:
- msg = f.read()
- self.wfile.write(msg.encode('utf-8'))
-
- port = 12345
- handler = EigenerHandler
- address = ('', port)
-
- server = http.server.HTTPServer(address, handler)
- server.serve_forever()
|