I have a Python script that prints and returns all image files from a folder in the server.
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
I am calling this in Javascript using:
$.get("scripts/filename.py", function(data){
alert(data);
});
However, instead of the getting the 'printed' or returned data, it is just displaying the code from filename.py. Am I missing something here?
EDIT: By the way, I am using Google App Engine to host my website.