How to check whether a file exists using python From https://stackoverflow.com/questions/82831/how-do-i-check-whether-a-file-exists-using-python?rq=1
import os
os.path.exists(path) # returns whether the path (dir or file) exists or not
os.path.isfile(path) # returns whether the file exists or not