title: Pass Python array to javascript?
body: <p>I'm new to HTML/javascript.  I'm running a local server, with an html/javascript file and a separate python script.  </p>
  
  <p>Question: <strong>How do I pass a python array to javascript variable?</strong></p>
  
  <p>Work so far: 
  I've written the array to file <code>data.txt</code>: </p>
  
  <pre><code>1  32.1
  2  10.0
  </code></pre>
  
  <p>but I could put it in JSON format if it's easier.</p>
  
  <p><strong>Here's my progress so far</strong>: </p>
  
  <pre><code>var x_pos = [];
  jQuery.get('http://127.0.0.1:8000/data/data.txt',function(data){
  
  // ??? Code here ???
  
  });
  
  console.log(x_pos[0])
  </code></pre>
  
  <p>Note: if there is a much simpler way to do this, I'm open to suggestion.  Thanks.</p>