title: CGI - HTML to python
body: <p>I am following the tutorial <a href="https://www.tutorialspoint.com/python/python_cgi_programming.htm" rel="nofollow noreferrer">CGI</a>, when I try to execute the program </p>
  
  <pre><code>#!C:/Python27/python.exe
  # Import modules for CGI handling 
  import cgi, cgitb 
  
  # Create instance of FieldStorage 
  form = cgi.FieldStorage() 
  
  # Get data from fields
  first_name = form.getvalue('first_name')
  last_name  = form.getvalue('last_name')
  
  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;Hello %s %s&lt;/h2&gt;" % (first_name, last_name)
  print "&lt;/body&gt;"
  print "&lt;/html&gt;"
  </code></pre>
  
  <p>The HTML file</p>
  
  <pre><code>&lt;form action = "/cgi-bin/hello_get.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;
  </code></pre>
  
  <p>In my browser on submitting the values, my python file is displaying as it is.
  Blankly my code was shown by the browser. Even it didn't get the first name and last name. What is the problem?</p>
  
  <p>I am unable to find where I am doing the mistake. </p>