这段代码在命令行上可以正常执行, 如何让它能运行在httpd 2.0 上??

这段代码在命令行上可以正常执行, 如何让它能运行在httpd 2.0 上??

以下这段代码在命令行上可以正常执行(python MySpaceTv.py),  如何让它能运行在httpd 2.0 上??  请教各位python前辈!! 谢谢!!

############################################################

print "Content-type: text/html\n\n"

from BeautifulSoup import BeautifulSoup
import sys
import MySpaceConstants
import MySpaceHtml
import re
import os
import cgi
import cgitb;
import httplib


cgitb.enable(display=0, logdir="/tmp")


form = cgi.FieldStorage()
urls = form.getlist("url")
#url  = str(urls[0])
url  = "vids.myspace.com"

# Get the page and set the input
connection = httplib.HTTPConnection(url)
connection.request("GET", "")
r1 = connection.getresponse()
strInput = r1.read()
connection.close()

# Create the tree and correct it (to be manipulated)
soup = BeautifulSoup(''.join(strInput))
soup.prettify()

# Remove all the 'class = col_3' fields
comments = soup.findAll(attrs={"class" : "col_3"})
[comment.extract() for comment in comments]

# Remove all the 'class = moreFeaturedVideoLinks' fields
comments = soup.findAll(attrs={"class" : "moreFeaturedVideoLinks"})
[comment.extract() for comment in comments]

# Removing the upload file link ('id=upload_videos_link')
comments = soup.findAll(attrs={"id" : "upload_videos_link"})
[comment.extract() for comment in comments]

# Removing the sposored links
comments = soup.findAll(attrs={"id" : "ctl00_vidsBody_TVHome_GoogleAFC"})
[comment.extract() for comment in comments]

# Filtering the tabs(videos, video charts, etc...)
result1 = soup.findAll(attrs={"id" : "vids_tabs"})

# Filtering the real videos links
result2 = soup.findAll(attrs={"id" : "layout_home2"})

# Concatenate the two string
result = str(result1[0]) + str(result2[0])

# The links have to be change by adding the processing script and query string
result = result.replace('href=\"/', 'href=\"')
result = result.replace('href=\"',  'href=\"' + MySpaceConstants.QUERY_STRING)

# the videoid...
count = result.count(MySpaceConstants.KEY_VIDEOID)
while count > 0:
    result = MySpaceHtml.replaceVideoUrl(result)
    count = result.count(MySpaceConstants.KEY_VIDEOID)

# Create the HTML file
outputHtml = MySpaceConstants.HTML_HEADER + result + MySpaceConstants.HTML_FOOTER

# Print the result on the output (browser)
print outputHtml

############################################################
为何总是报这个错?

[Tue Aug 14 20:01:54 2007] [error] [client 10.0.18.114] PythonHandler MySpaceTv: Traceback (most recent call last):
[Tue Aug 14 20:01:54 2007] [error] [client 10.0.18.114] PythonHandler MySpaceTv:   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 287, in HandlerDispatch\n    log=debug)
[Tue Aug 14 20:01:54 2007] [error] [client 10.0.18.114] PythonHandler MySpaceTv:   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 457, in import_module\n    module = imp.load_module(mname, f, p, d)
[Tue Aug 14 20:01:54 2007] [error] [client 10.0.18.114] PythonHandler MySpaceTv:   File "/var/www/html/myspace/MySpaceTv.py", line 16, in ?\n    form = cgi.FieldStorage()
[Tue Aug 14 20:01:54 2007] [error] [client 10.0.18.114] PythonHandler MySpaceTv:   File "/usr/lib/python2.3/cgi.py", line 447, in __init__\n    elif sys.argv[1:]:
[Tue Aug 14 20:01:54 2007] [error] [client 10.0.18.114] PythonHandler MySpaceTv: AttributeError: 'module' object has no attribute 'argv'