开发者

Can we run python progam in cgi?

开发者 https://www.devze.com 2023-02-28 22:56 出处:网络
The HTML form that I makes use of uses browse option and the file format uploadedis like this(/home/anu/anu.py). Nowsince in the form action the processing takes place in the server side. can we use C

The HTML form that I makes use of uses browse option and the file format uploaded is like this(/home/anu/anu.py). Now since in the form action the processing takes place in the server side. can we use CGI for taking the filename as input and process the 开发者_高级运维text using the python program in the hard disk and display the output on the web page. Is there any code available? can we run python program in the hard disk using CGI?


Yes, you can run Python programs with CGI. The cgi standard module will help.


In Apache you can configure additional extensions to be treated as cgi.
The directory that contains the CGI will have to have these option included

Options Indexes FollowSymLinks ExecCGI
AddHandler cgi-script .cgi .py

0

精彩评论

暂无评论...
验证码 换一张
取 消