Automatically get the latest json file if only given a folder as path #33
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ def main(*_args):
|
|||
# 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])
|
||||
file_path = os.path.join(file_path, filesList[-1])
|
||||
|
||||
else:
|
||||
print("Please enter a valid json file or the directory containing the json file!")
|
||||
|
|
Loading…
Reference in a new issue