如何在html中传递参数给python脚本,并且启动脚本

2024-12-23 05:45:09
推荐回答(2个)
回答1:

It probably would depend on what you want to do. I personally use CGI
and it might be simpler if your inputs from the web page are simple,
and it takes less time to learn. Here are some resources for it:

https://docs.python.org/2/library/cgi.html
https://www.tutorialspoint.com/python/python_cgi_programming.htm
There's a simple example in the end of this one although it mainly focuses on HTML forms: http://abacles.com/html-forms.html

However you may still have to do some configuring to allow it to run the program instead of displaying it.

Here's a tutorial on that: http://httpd.apache.org/docs/current/howto/cgi.html

回答2:

卧槽你绝对不是中国人