我只是启动一个网络服务器:python -m http.server
并制作一个 htm:Friends CGI Demo(静态屏幕)
<BODY>
<H3>Friends list for:<I>NEW USER</I></H3>
<FORM ACTION = "/cgi-bin/test.py">
<B>Enter your Name:</B>
<INPUT TYPE = text NAME = person VALUE = "NEW USER" SIZE = 15>
<P><B>How many friends do you have?</B>
<INPUT TYPE = radio NAME = howmany VALUE = "0" CHECKED> 0
<INPUT TYPE = radio NAME = howmany VALUE = "10" > 10
<INPUT TYPE = radio NAME = howmany VALUE = "25" > 25
<INPUT TYPE = radio NAME = howmany VALUE = "50" > 50
<INPUT TYPE = radio NAME = howmany VALUE = "100" > 100
</P><INPUT TYPE = submit>
</FORM>
</BODY>
</HTML>
然后,编写一个 test.py:#!c:\Python33\python.exe import cgi
print('Content-Type:text/html\n\n')
print('hello cgi')
这是CorePython的一个cgi示例,但它不起作用,我使用python3.3,我谷歌并修复它,但它仍然不起作用,错误是:code 404 message File nof found,看起来像test.py找不到,我已经创建了一个 cgi-bin 目录,并将 test.py 放入其中。我完全糊涂了,寻求您的帮助