title: Force reload on SimpleHTTP Server in Python
body: <p>I have a very simple HTTPServer implemented in Python. The code is the following:</p>
  
  <pre><code>import SimpleHTTPServer
  import SocketServer as socketserver
  import os
  import threading
  
  class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
      path_to_image = 'RGBWebcam1.png'
      img = open(path_to_image, 'rb')
      statinfo = os.stat(path_to_image)
      img_size = statinfo.st_size
      print(img_size)
  
  def do_HEAD(self):
      self.send_response(200)
      self.send_header("Content-type", "image/png")
      self.send_header("Content-length", img_size)
      self.end_headers()
  
  def do_GET(self):
      self.send_response(200)
      self.send_header("Content-type", "image/png")
      self.send_header("Content-length", img_size)
      self.end_headers() 
      f = open(path_to_image, 'rb')
      self.wfile.write(f.read())
      f.close()         
  
  class MyServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
      def __init__(self, server_adress, RequestHandlerClass):
          self.allow_reuse_address = True
          socketserver.TCPServer.__init__(self, server_adress, RequestHandlerClass, False)
  
  if __name__ == "__main__":
      HOST, PORT = "192.168.2.10", 9999
      server = MyServer((HOST, PORT), MyHandler)
      server.server_bind()
      server.server_activate()
      server_thread = threading.Thread(target=server.serve_forever)
      server_thread.start()
      while(1):
          print "test"
  </code></pre>
  
  <p>If I connect to the given IP-Adress the page loads and everything is fine. Now it would be nice if the page would automatically refresh every n seconds. 
  I am very new to python and especially new to webcoding. I have found <a href="https://pypi.python.org/pypi/livereload" rel="nofollow noreferrer">LiveReload</a> however I cannot get my head around how I merge these two libraries together. </p>
  
  <p>Thank you for your help</p>