Jul-31-2020, 05:57 PM
(This post was last modified: Jul-31-2020, 05:57 PM by Gribouillis.)
Normally, in any language, if one attempts to open a file for reading and the file doesn't exist there is an error
The solution of bugs doesn't come out of the blue, it comes from exposing the data used by the program at run time.
>>> open('spam.txt') Traceback (most recent call last): File "<stdin>", line 1, in <module> FileNotFoundError: [Errno 2] No such file or directory: 'spam.txt'The problem in your case is to investigate the cause of the error, that's why I suggest that you print a maximum information about the file to be opened before the error occurs.
The solution of bugs doesn't come out of the blue, it comes from exposing the data used by the program at run time.