Automatically get the latest json file if only given a folder as path #33
Loading…
Reference in a new issue
No description provided.
Delete branch "automatically-get-latest-file"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -70,0 +78,4 @@
# we want the latest json file in given folder
filesList = [f for f in os.listdir(file_path) if os.path.isfile(os.path.join(file_path, f)) and f.endswith(".json")]
filesList.sort()
file_path = os.path.join(file_path, filesList[len(filesList) - 1])
filesList[-1] müsste reichen, um das letzte Element zu bekommen.
Oh diese Syntax kenne ich gar nicht :)