Use better variant to get the last element
This commit is contained in:
parent
914881a104
commit
2c0fdb13c7
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
|
# 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 = [f for f in os.listdir(file_path) if os.path.isfile(os.path.join(file_path, f)) and f.endswith(".json")]
|
||||||
filesList.sort()
|
filesList.sort()
|
||||||
file_path = os.path.join(file_path, filesList[len(filesList) - 1])
|
file_path = os.path.join(file_path, filesList[-1])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Please enter a valid json file or the directory containing the json file!")
|
print("Please enter a valid json file or the directory containing the json file!")
|
||||||
|
|
Loading…
Reference in a new issue