import os, sys
inputFilename = 'X.txt'
if not os.path.exists(inputFilename):
print('The file %s does not exist. Quitting...' % (inputFilename))
sys.exit()
This code is only meant to run when the txt file X is not found. But for some reason it keeps running these lines, even though the file does exist in the right place. Any ideas what I'm doing wrong? I've tried moving everything into a separate folder and renaming file, nothing seems to be working.