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.
source
share