mkdir -p cgi/cgi-bin ;
gvim time.py
#!/usr/bin/env python
# -*- coding utf8 -*-
import cgitb
cgitb.enable()
import time
print "Content-type: text/html"
print
print time.strftime('%Y-%m-%d %X', time.localtime() )
form = cgi.FieldStorage()
# Get data from field 'name'
name = form.getvalue('name')
cgi 服务器建立
cd cgi
python -m CGIHTTPServer
到 firefox 中
http://127.0.0.1:8000/cgi-bin/time.py
2009-04-07 23:26:03
整理 www.blogjava.net/Good-Game