title: How do I connect front end HTML/JQuery to backend Python
body: <p>I have a web page that is written in HTML, and the actions are completed using JQuery.  The html code below doesn't use any of the JQuery, but I figured I'd mention that since I may need to put some AJAX in there.</p>
  
  <p>Here is the "front end"</p>
  
  <p><em>index.html</em></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt;
  &lt;script src="javaScript.js"&gt;&lt;/script&gt;
  
  &lt;html&gt;
  
  &lt;div id="liveOutputTitle"&gt;
  &lt;h1&gt;&lt;span&gt;Live Output&lt;/span&gt;&lt;/title&gt;
  &lt;/div&gt;
  
  &lt;div id="liveOutput"&gt;
  Value 1 From Python: &lt;input type="text" name="Value1" id="Value1" value="0"&gt;&lt;br&gt;
  
  Value 2 From Python: &lt;input type="text" name="Value2" id="Value2" value="0"&gt;&lt;br&gt;
  
  Value 3 From Python: &lt;input type="text" name="Value3" id="Value3" value="0"&gt;&lt;br&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I have a JQuery file, that doesn't affect anything that i've put in the html file. But here's a reference to that file.</p>
  
  <p><em>jquery.js</em></p>
  
  <pre><code>$(document).ready(function(){
      //logic for other functionality of the site
  
      //I'm assuming some AJAX goes here
  });
  </code></pre>
  
  <p>My end goal is to have a python program that pulls values from somewhere, and I'd like to have those values shown in the input fields.  </p>
  
  <p>My python "server side" code. does something like below:</p>
  
  <p><em>serverSide.py</em></p>
  
  <pre><code>#!/usr/bin/env python
  
  def getValueOne():
      //gets the value from wherever
      valueOne = 1
  
  def getValueTwo():
      //gets the value from wherever      
      valueTwo = 2
  
  def getValueThree():
      //gets the value from wherever
      valueThree = 3
  </code></pre>
  
  <p>How do I get the values here, in the python, to show as these values change, to the respective input values in the HTML?</p>
  
  <p>I've tried figuring that out using some tutorials on AJAX, but I haven't managed to get the logic completely together.  I've read through <a href="https://realpython.com/blog/python/django-and-ajax-form-submissions/" rel="nofollow">this</a>, <a href="http://flask.pocoo.org/docs/0.10/patterns/jquery/" rel="nofollow">this</a>, and <a href="http://www.giantflyingsaucer.com/blog/?p=4310" rel="nofollow">this</a>, but I'm still not exactly sure how to connect this logic.  Any help is appreciated.</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>I'm sure someone will say that I should have mentioned what frame work I want to use (assuming you have to use a framework).  I'm not sure, but I've read a lot about flask, and if I had to randomly choose one, I would use flask.</p>