¿Cómo ejecutar el script de python en el BaseHTTPSERVER creado por python?

Simplemente he creado un servidor python con:

python -m SimpleHTTPServer

Tuve un .htaccess (no sé si es útil con el servidor Python) con:

AddHandler cgi-script .py
Options +ExecCGI

Ahora estoy escribiendo un simple script en python:

#!/usr/bin/python
import cgitb
cgitb.enable()
print 'Content-type: text/html'
print '''
<html>
     <head>
          <title>My website</title>
     </head>
     <body>
          <p>Here I am</p>
     </body>
</html>
'''

Hago test.py (nombre de mi script) un archivo ejecutado con:

chmod +x test.py

Estoy lanzando Firefox con esta dirección: (http: //) 0.0.0.0:8000/test.py

Problema, el script no se ejecuta ... Veo el código en la página web ... Y el error del servidor es:

localhost - - [25/Oct/2012 10:47:12] "GET / HTTP/1.1" 200 -
localhost - - [25/Oct/2012 10:47:13] code 404, message File not found
localhost - - [25/Oct/2012 10:47:13] "GET /favicon.ico HTTP/1.1" 404 -

¿Cómo puedo gestionar la ejecución del código de Python simplemente? ¿Es posible escribir en un servidor de Python para ejecutar el script de Python como con algo como eso?

import BaseHTTPServer
import CGIHTTPServer
httpd = BaseHTTPServer.HTTPServer(\
    ('localhost', 8123), \
CGIHTTPServer.CGIHTTPRequestHandler)
###  here some code to say, hey please execute python script on the webserver... ;-)
httpd.serve_forever()

O algo mas...

Respuestas a la pregunta(2)

Su respuesta a la pregunta