invoking a python script on click of HTML button can be accomplished using python-django framework.
The ajax for it is written this way
<input type = “button” id=”b1″ value=”1″>
<script>
$(document).ready(function(){
$("#b1").click(function(){
$.ajax({
method: "GET",
url: "type your python script path here",
data: {"place" : value},
dataType: "text",
success: function(result){
var data=JSON.parse(result);
console.log(result);
}
});
});
</script>
hope this works
Invoking a python script can be accomplished using python-django framework.
1.Install django- pip install django
2.create a django project and an app.
3.add urls accordingly.
4.write your python script in views.py
5.invoke the function in views.py from your html file using ajax.
Refer django documentation for complete details.