title: Unable to display images in browser using python
body: <p>I'm trying to create a simple web browser.
  I have an index.html file placed in my local. I'm trying to start a client server connection and then display the html file in the browser.</p>
  
  <p>I'm able to open the index.html file and read it's contents except some of it's contents. There are links which point to the images in the local directory, but when clicked on it in browser, it's not opening.</p>
  
  <p>Here is the sample code.</p>
  
  <pre><code>    HOST, PORT = '', 8888
  
  listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  listen_socket.bind((HOST, PORT))
  listen_socket.listen(1)
  
  listen_socket.listen(1)
  print('Serving HTTP on port %s ...' % PORT)
  os.chdir("some directory where index.html is present")
  open_file=open('index.html','r')
  print(os.getcwd())
  #http_response=open_file.read()
  
  """ sample html code where image exists
  &lt;image src="./images/welcome.png" height=180px /&gt;
  The index.html is perfectly fine, but i'm not able to display the images
  in browser"""
  
  
  while True:
      client_connection, client_address = listen_socket.accept()
      request = client_connection.recv(1024)
      print(request.decode('utf-8'))
  
      http_response = open_file.read()
  
  
  
      client_connection.sendall((str.encode(http_response)))
      client_connection.close()
  </code></pre>
  
  <p>Is there some kind of special encoding that needs to be done for displaying images?</p>
  
  <p>Please note that I can't use any external modules.</p>