Created
March 17, 2017 16:10
-
-
Save pcote/0eaa75e883dfd01f7beb0e2703fff18c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route("/filenames", methods=["GET"]) | |
def get_filenames(): | |
filenames = os.listdir("uploads/") | |
modify_time_sort = lambda f: os.stat("uploads/{}".format(f)).st_atime | |
filenames = sorted(filenames, key=modify_time_sort) | |
return_dict = dict(filenames=filenames) | |
return jsonify(return_dict) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment