import http.server
import urllib.parse
class newHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
parseUrl = urllib.parse.urlparse(self.path)
path = parseUrl.path
if path == "/Yang":
msg1 = "" + path + ""
elif path == "/Ying":
msg1 = "" + path + ""
self.wfile.write(msg1.encode('utf-8'))
PORT = 4096
HANDLER = newHandler
ADDRESS = ('', PORT)
SERVER = http.server.HTTPServer(ADDRESS, HANDLER)
SERVER.serve_forever()