def get_checker_name(path_to_db, topic_name): print( "\nPlease provide the checker name (e.g. the name of the file, including extension)" ) all_checker_names = DbHandler.get_checker_names(path_to_db) while True: checker_name = input("Checker name: ") if checker_name in all_checker_names: print("Checker name already exists for topic " + DbHandler.get_topic_for_checker(path_to_db, checker_name)) else: if not os.path.exists("scripts/" + topic_name.lower() + "/" + checker_name): print("File scripts/" + topic_name.lower() + "/" + checker_name + " not found.") else: return checker_name