For a school project I would like to be able to call some functions in a file "app.py" from "index.html".
In fact, the py file generates some things and then I have to insert the generated things into "index.html". I know how to insert the response from the py script but I don't know how to call it.
Here is app.py (that's only to illustrate)
def main():
return "insert this into the html page!"
<script>
function insert()
{
?
}
</script>
<input type="button" value="click to insert" onclick="insert()">
I tried with Flask but when I call the script, well, it works, but then it switches to another page...
So, I would like to do what i'm trying to do WITHOUT Node.js or React or things (don't ask me why I'm too lazy to explain)
And yes, I need to use a py script
Thanks for your help
Sorry for my bad english if you i'm clear just tell me i'll try to explain you