title: Call python function from HTML page
body: <p>For a school project I would like to be able to call some functions in a file "app.py" from "index.html".<br>
  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. </p>
  
  <p>Here is app.py (that's only to illustrate)</p>
  
  <pre class="lang-py prettyprint-override"><code>def main():
      return "insert this into the html page!"
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;
  function insert()
  {
      ?
  }
  &lt;/script&gt;
  
  &lt;input type="button" value="click to insert" onclick="insert()"&gt;
  </code></pre>
  
  <p>I tried with Flask but when I call the script, well, it works, but then it switches to another page...<br>
  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)<br>
  And yes, I need to use a py script  </p>
  
  <p>Thanks for your help<br>
  Sorry for my bad english if you i'm clear just tell me i'll try to explain you</p>