diff --git a/edit_data_form.py b/edit_data_form.py index 605f18c..7c41f17 100755 --- a/edit_data_form.py +++ b/edit_data_form.py @@ -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!")