开发者

call a server side python script from javascript

开发者 https://www.devze.com 2022-12-25 17:53 出处:网络
how to call a server side python script from javascript. if test.py is the python script file in server, and if the parameter to be passed to python is another url , then how开发者_StackOverflow中文版

how to call a server side python script from javascript. if test.py is the python script file in server, and if the parameter to be passed to python is another url , then how开发者_StackOverflow中文版 this can be executed from javascript, how the return string from python script is obtained to the javascript.


You can directly call the python script from javascript. You need to use an appropriate server-side technology (asp.net, php, servlet). The best solution will be to create a REST service, by defining a URL, which when called (through ajax for example) will execute the python script and write the output to the body of the request. This will be easier if you are using django or another python web framework.

0

精彩评论

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

关注公众号