I have written a program on Files I/O in Python, which contains a part where the file is opened i.e
....
f = open("<filename.txt", "r")
alltext = f.readlines()
....
In the case where the file is not found, I want to write a print statement saying, "Sorry, file not found." I tried using error handling (for & except), which did not work well because of the nested code after the above. Any help would be appreciated.
Thanks