from http.server import HTTPServer, BaseHTTPRequestHandler


class Serv(BaseHTTPRequestHandler):

  def do_GET(self):
    if self.path == '/':
      self.path = '/index.html'
                                      try:
                                        file_to_open
                                                    = open(self.path[1:]).read()
                                                                self.send_response(200)
                                      except:
                                        file_to_open
                                                                                      = "File
                                                                                      not
                                                                                      found"
                                                                                                  self.send_response(404)
                                                                                                          self.end_headers()
                                                                                                                  self.wfile.write(bytes(file_to_open,
                                                                                                                    'utf-8'))


                                                                                                                  httpd
                                                                                                                  = HTTPServer(('localhost',
                                                                                                                    8000),
                                                                                                                    Serv)
                                                                                                                  httpd.serve_forever()

af4ecf422d6fc3353d979b0ea8b628772e35d48e
from http.server import HTTPServer, BaseHTTPRequestHandler


class Serv(BaseHTTPRequestHandler):

  def do_GET(self):
    if self.path == '/':
      self.path = '/index.html'
                                      try:
                                        file_to_open
                                                    = open(self.path[1:]).read()
                                                                self.send_response(200)
                                      except:
                                        file_to_open
                                                                                      = "File
                                                                                      not
                                                                                      found"
                                                                                                  self.send_response(404)
                                                                                                          self.end_headers()
                                                                                                                  self.wfile.write(bytes(file_to_open,
                                                                                                                    'utf-8'))


                                                                                                                  httpd
                                                                                                                  = HTTPServer(('localhost',
                                                                                                                    8000),
                                                                                                                    Serv)
                                                                                                                  httpd.serve_forever()
