You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Yang.py 721B

5 years ago
12345678910111213141516171819202122232425262728
  1. import http.server
  2. class EigenerHandler(http.server.BaseHTTPRequestHandler):
  3. def do_GET(self):
  4. self.send_response(200)
  5. self.send_header('Content-type', 'text-html')
  6. self.end_headers()
  7. msg = """
  8. <html>
  9. <head>
  10. <title> Yang </title>
  11. <head>
  12. <body>
  13. <b>Yang<b>
  14. <p>Hello. To the website <a href="http://localhost:12345/">Ying</a>?<br /></p>
  15. <body>
  16. <html>
  17. """
  18. self.wfile.write(msg.encode())
  19. port = 54321
  20. Handler = EigenerHandler
  21. address = ('', port)
  22. server = http.server.HTTPServer(address, Handler)
  23. server.serve_forever()