def do_GET(self): | def do_GET(self): | ||||
self.send_response(200) | self.send_response(200) | ||||
self.end_headers() | self.end_headers() | ||||
msg = | |||||
self.wfile.write() | |||||
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() |
<body> | <body> | ||||
<div> Yang </div> | <div> Yang </div> | ||||
<div> | <div> | ||||
<a> href="Yong.html"</a> | |||||
<a href="Ying.html">Ying</a> | |||||
</div> | </div> | ||||
</body> | </body> | ||||
</html> | </html> |
<body> | <body> | ||||
<div> Ying </div> | <div> Ying </div> | ||||
<div> | <div> | ||||
<a> href= "Yang.htlm" </a> | |||||
<a href= "Yang.htlm">Yang</a> | |||||
</div> | </div> | ||||
</body> | </body> | ||||
</html> | </html> |