开发者

Can we run python progam in cgi?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜