且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从AJAX或JQuery的运行Python脚本

更新时间:2023-12-05 08:17:04

您Ajax调用将是一个Web请求(HTTP)的python脚本,让你的Python脚本需要的端口这样的请求在倾听和回应回去。

Your Ajax call will be a web request (http) to the python script, so your python script needs to listen on the port for such requests and respond back.

上述方法建议,用简单的 Web服务器样品内,PY或者你可以使用现有的如瓶(或其他许多人)。

Above mentioned method is recommended, to use simple web server inside your sample ,py or you can use an existing ones such as Flask (or many others).

仅供参考 - 为您简单的任务,我不会推荐Django的(它是一个又大又重的web框架,有很多的钟声你不需要)

FYI - for your simple task I would not recommend Django (its a big and heavy web framework with lots of bells you do not need).