Versuchen Sie es mit der Datei zu öffnen
try:
with open("file.txt","r") as f:
#stuff goes here
except IOError:
#do what you want if there is an error with the file opening
Beautiful Bee