Web サーバーを起動するだけです: 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 を使用し、Google で修正しましたが、それでも動作しません。エラーは次のとおりです。コード 404 メッセージ File nof found, look like test.py cannot be found, cgi-bin ディレクトリを作成し、そこに test.py を入れました。私は完全に混乱しました、あなたの助けを探してください