Execute a python script on button click

You can use Ajax, which is easier with jQuery

$.ajax({
   url: "/path/to/your/script",
   success: function(response) {
     // here you do whatever you want with the response variable
   }
});

and you should read the jQuery.ajax page since it has too many options.

Leave a Comment