title: Python 2.7.8 End of script output before headers: te.py
body: <p>I am using <code>Ubuntu 12.04</code> using Vmware and working on <code>Python cgi-bin</code>. I am following this tutorial: <a href="http://archive09.linux.com/feature/136602" rel="nofollow">http://archive09.linux.com/feature/136602</a> . My example1.py <code>"Hello, Linux.com!"</code> is printing successfully but example2.py is not and server is constantly saying:</p>
  
  <pre><code>Server error!
  
  The server encountered an internal error and was unable to complete your request.
  
  Error message:
  End of script output before headers: te.py
  
  If you think this is a server error, please contact the webmaster.
  Error 500
  localhost
  Apache/2.4.16 (Unix) OpenSSL/1.0.1p PHP/5.6.12 mod_perl/2.0.8-dev Perl/v5.16.3 
  </code></pre>
  
  <p>And the code is:</p>
  
  <pre><code>#!/usr/bin/python
  import cgi
  print "Content-type: text/html"
  print
  form = cgi.FieldStorage()
  laptops = form.getvalue('laptops','0')
  desktops = form.getvalue('desktops','0')
  print """
  &lt;html&gt;
  &lt;body&gt;
  &lt;form action='second.py'&gt;
  How many laptops do you own?&amp;nbsp;
  &lt;input type='radio' checked name='laptops' value='0' /&gt;0&amp;nbsp;
  &lt;input type='radio' name='laptops' value='1' /&gt;1&amp;nbsp;
  &lt;input type='radio' name='laptops' value='2' /&gt;2
  &lt;p&gt;
  How many desktops do you own?&amp;nbsp;
  &lt;input type='radio' checked name='desktops' value='0' /&gt;0&amp;nbsp;
  &lt;input type='radio' name='desktops' value='1' /&gt;1&amp;nbsp;
  &lt;input type='radio' name='desktops' value='2' /&gt;2
  &lt;p&gt;
  &lt;input type='submit' /&gt;
  &lt;p&gt;
  You own %d computers.
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;""" % (int(laptops)+int(desktops))
  </code></pre>
  
  <p>I am myself fail and cannot figure out the reason. Kindly help</p>