Hi,
I'm just wondering if it's possible to use an exception with
I'm just wondering if it's possible to use an exception with
isfile without opening it (ot course it/then/else do the job): just a reflexiontry:
os.path.isfile(os.path.join(os.getcwd(), 'file.txt'))
# open(os.path.join(os.getcwd(), 'file.txt'), 'r')
except FileNotFoundError:
print("file not found")
