我有一个html格式的表单,其中action = "pyth.py“
而pyth.py是
#!/usr/bin/python
print('Content-type: text/html\r\n\r')
print('<html><head></head><body>My first page</body></html>')因此,当我在表单中单击submit时,它应该会运行pyth.py,并给我一个html输出。但事实并非如此。请帮帮我
发布于 2017-07-26 05:09:28
您必须在run服务器的cgi-bin中运行python脚本。您的html表单操作应为action="/cgi-bin/pyth.py"。Check out this tutorial。
https://stackoverflow.com/questions/45312024
复制相似问题