try:
file = open("<the file's location on your computer>", "r")
# Do the stuff you want it to do with the file here
file.close()
except:
# Do this if the file's not there
It tries to open the file in read mode, and if it can’t do that, it goes on the the “except:” bit.