title: Passing input from html to python and back
body: <p>I need to make a webpage for an assignment, it doesn't have to be uploaded to the web, I am just using a local .html file.
  I did some reading up and came up with the following html and python:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;
              CV - Rogier
          &lt;/title&gt;
      &lt;/head
      &lt;body&gt;
          &lt;h3&gt;
              Study
          &lt;/h3&gt;
          &lt;p&gt;
              At my study we learn Python.&lt;br&gt;
              This is a sall example:&lt;br&gt;
              &lt;form action="/cgi-bin/cvpython.py" method="get"&gt;
                  First Name: &lt;input type="text" name="first_name"&gt;  &lt;br /&gt;
                  Last Name: &lt;input type="text" name="last_name" /&gt;
                  &lt;input type="submit" value="Submit" /&gt;
              &lt;/form&gt;
          &lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Python:</p>
  
  <pre><code>import cgi
  import cgitb #found this but isn't used?
  
  form = cgi.FieldStorage()
  
  first_name = form.getvalue('first_name').capitalize()
  last_name  = form.getvalue('last_name').capitalize()
  
  print ("Content-type:text/html\r\n\r\n")
  print ("&lt;html&gt;")
  print ("&lt;head&gt;")
  print ("&lt;title&gt;Hello - Second CGI Program&lt;/title&gt;")
  print ("&lt;/head&gt;")
  print ("&lt;body&gt;")
  print ("&lt;h2&gt;Your name is {}. {} {}&lt;/h2&gt;".format(last_name, first_name, last_name))
  print ("&lt;/body&gt;")
  print ("&lt;/html&gt;")
  </code></pre>
  
  <p>However this just gives the prints as text and not as a proper html file with the 1 line that I want.</p>