Add a script map
Request Path: *.py
Executable: C:\Python25\Python.exe %s %s
Name: Python
Add a file to the directory call it test.py
print 'Status: 200 OK'
print 'Content-type: text/html'
print ''
print ''
print '
This is a header
'print '
' #this is a comment
print 'See this is just like most other HTML'
print '
'
print ''
Navigate to http://localhost/myWeb/test.py
Query strings and other HTTP parameters can be accessed through:
method = os.environ["REQUEST_METHOD"]
if method == "GET":
query = cgi.FieldStorage()
coName = query.getvalue("co")
No comments:
Post a Comment