title: Return data from Python to Javascript
body: <p>I have a Python script that prints and returns all image files from a folder in the server.</p>
  
  <pre><code>import os
  images = ""
  for dirname, dirnames, filenames in os.walk('..\directory'):
      for filename in filenames:
          images = images + os.path.join(dirname, filename) + "^"
  print(images)
  return images
  </code></pre>
  
  <p>I am calling this in Javascript using:</p>
  
  <pre><code>$.get("scripts/filename.py", function(data){
    alert(data);
  });
  </code></pre>
  
  <p>However, instead of the getting the 'printed' or returned data, it is just displaying the code from filename.py. Am I missing something here? </p>
  
  <p>EDIT:
  By the way, I am using Google App Engine to host my website.</p>