valid_file = False while not valid_file: dest_file = input("Enter file's path: ") try: retval = openfile(dest_file) except FileNotFoundError: print("Invalid file path given") else: valid_file = True
2.1m questions
2.1m answers
60 comments
57.0k users