I write the html code as bellow,
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<button onclick="Call_pyth()">Call Fun</button>
<p id="para"></p>
<script>
function Call_pyth(){
$.ajax({
type: "POST",
url: "~/Pythoncode.py",
data: { param: "Balgopal"}
}).done(function( o ) {
console.log("Called");
console.log(o)
});
}
</script>
</body>
</html>
And my Python file is
def Name(x):
return x*2
please help me in this case ,That how can I call that function from that html file.