title: How to execute Python CGI Script?
body: <p>I want to execute a Python CGI Script within a <code>.shtml</code>
  file, but I just can't figure out how. I already found several ways?, but nothing seemed to work. And there it was a lot harder to find something that actually shows how to <em>execute</em> a script, and not how to write one ! ;/</p>
  
  <p>My Html:
  <a href="http://pastebin.com/4sNZTZNQ" rel="nofollow">http://pastebin.com/4sNZTZNQ</a></p>
  
  <p>And my Script:
  <a href="http://pastebin.com/w5vGXCBp" rel="nofollow">http://pastebin.com/w5vGXCBp</a></p>
  
  <p>I'm very new to CGI and any Webstuff, but I'm programming with Python over half an year now.</p>
  
  <p>PS: Sorry for the confusing formatting of the code, I now uploadednit onto pastebin :S</p>
  
  <p>//edit:
  Ok, now some more information, because it still does not work.</p>
  
  <p>From heliohost.org, i was directed to <a href="http://area52.heliohost.org/cgi-bin/snakecharmer.py" rel="nofollow">http://area52.heliohost.org/cgi-bin/snakecharmer.py</a> where you can find the paths to python interpreters.</p>
  
  <p>This is my Folder Structure:<br>
  - public_html
   - .htaccess
   - main.py
   - index.shtml</p>
  
  <p>Content of .htaccess:</p>
  
  <pre><code>Options +ExecCGI
  AddHandler cgi-script .py
  </code></pre>
  
  <p>Content of main.py:</p>
  
  <pre><code>#! /usr/local/bin/python
  print "Content-Type: text/html"
  print
  
  print "Hello World!"
  </code></pre>
  
  <p>Content of index.shtml:
  <a href="http://pastebin.com/Trg8sXBc" rel="nofollow">http://pastebin.com/Trg8sXBc</a></p>
  
  <p>Now, clicking on the link, an "500 InternalServerError" Appears, and I don't understand why. :(</p>
  
  <p>The Server error-log just says this:</p>
  
  <pre><code>[Wed Jun 15 14:41:26 2011] [error] [client 84.151.252.129] File does not exist: /home/nux95/public_html/500.shtml, referer: http: niklasrosenstein.heliohost.org/
  </code></pre>