title: cgi doesn't execute HTML
body: <p>I'm currently trying to build a python server in order to create a web site running python code as back-end.For that I'm using cgi first (as a test) to display a html page but it doesn't work. </p>
  
  <p>For that I'm using cgi first (as a test) to display a html page but it doesn't work.</p>
  
  <p>here the code of my server :
      import http.server</p>
  
  <pre><code>PORT = 8888
  server_address = ("", PORT)
  
  server = http.server.HTTPServer
  handler = http.server.CGIHTTPRequestHandler
  handler.cgi_directories =     ["/Users/mydirectory/Desktop/STAGE_AREMIS_FRANCE/python"]
  print("Serveur actif sur le port :", PORT)
  
  httpd = server(server_address, handler)
  httpd.serve_forever()
  </code></pre>
  
  <p>and here to one of the index :
      # coding: utf-8</p>
  
  <pre><code>import cgi
  
  form = cgi.FieldStorage()
  print("Content-type: text/html; charset=utf-8\n")
  
  print(form.getvalue("name"))
  
  html = """&lt;!DOCTYPE html&gt;
  &lt;head&gt;
   &lt;title&gt;Mon programme&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="/index.py" method="post"&gt;
      &lt;input type="text" name="name" value="Votre nom" /&gt;
      &lt;input type="submit" name="send" value="Envoyer information au serveur"&gt;
  &lt;/form&gt; 
  &lt;/body&gt;
  &lt;/html&gt;
  """
  
  print(html)
  </code></pre>
  
  <p>I've read the doc of cgi and I can't figure why it doesn't work.
  Any ideas? 
  thanks for the help !</p>