在Nginx上提交表单时允许执行python脚本

问题描述

Please enter number of rows 2 Please enter number of columns 2 Enter first [0][0] integer 12 Enter first [0][1] integer 36 Enter first [1][0] integer 25 Enter first [1][1] integer 23 服务器上通过表单提交两个值时,我想执行一个简单的Python脚本,但是我收到一个Nginx错误

我使用以下形式,存储在405 Not allowed中:

/var/www/html/some_site/index.html

按下提交时我要执行的脚本存储在<form action="./py/script.py" method="post"> <input type="text" name="some_text"/> <input type="text" name="some_other_text"/> <input type="submit" value="Submit"/> </form> 中,并包含以下几行:

/var/www/html/some_site/py/script.py

如何告诉import cgi cgitb.enable() form = cgi.FieldStorage() some_text = form.getvalue('some_text') some_other_text = form.getvalue('some_other_text') # do stuff based on some_text and some_other_text 允许执行此脚本?这是我第一次尝试创建一个将输入传递给脚本的简单网站。任何帮助表示赞赏! :)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...