in my project I'm doing, I've always used this part of the script to check if a file existed or not:
path = os.path.join("myfile.txt")
conf = Path(path)
try:
lc = conf.resolve()
except FileNotFoundError:
print("new")
else:
print("load")
It always worked (I used Python 3.4). Now, for some reason, I wanted to change the interpreter and use Python 3.7.1
Now, I only get printed "load", regardless of whether the file exists or not. How should I solve?