title: How to properly send HTTP response with Python using socket library only?
body: <p>I have a very simple web sever written in Python. It listens on port 13000, how can I make it deliver a simple "Hello World" webpage if <code>http://localhost:13000</code> is opened in browser?</p>
  
  <p>Right there is my code:</p>
  
  <pre><code># set up socket and connection
  while True:
      sock, addr = servSock.accept()
      # WHAT GOES HERE?
      sock.close()
  </code></pre>
  
  <p>As you can see, I am not exactly sure how to actually send back the webpage?</p>
  
  <p>I only have to use the <code>socket</code> library.</p>
  
  <p><strong>EDIT:</strong> The problem is not that I don't know how to formulate the HTTP response, I don't know how to actually make it display in my browser! It just keeps spinning/loading.</p>