Call server side python script from javascript

how to call server side python script from javascript. if test.py is a python script file on the server, and if the parameter to be passed to python is a different url, then how can this be done from javascript, how is the return string from the python script in javascript obtained.

+3
source share
1 answer

You can directly call python script from javascript. You need to use the appropriate server technology (asp.net, php, servlet). The best solution would be to create a REST service by defining a URL that, when called (via ajax, for example) will execute a python script and write the output to the request body. It will be easier if you use django or other python web infrastructure.

+3
source

Source: https://habr.com/ru/post/1740136/


All Articles