I'm new to python and just can't seem to get the code I'm writing to carry on processing if a file doesn't exist in the directory I point it to. Basically, I'm opening each text file to make a small amendment. I've tried putting the (what I thought) is the correct code here
for filename in find_files('a-zA-Z0-9', '*.txt'):
if os.path.isfile(filename):
with an else at the end of the code which prints a messge file not found. But I still get an IOError no such file or directory, which brings the whole program to a stop. What am I doing wrong?
Many thanks