I realize this looks similar to other questions about checking if a file exists, but it is different. I\'m trying to figure out how to check that a type of
filenames = os.listdir(os.curdir)
found = False
for filename in filenames:
if os.path.isfile(filename) and filename.endswith('.fna'):
found = True
if not found:
sys.stderr.write ('No database file found. Exiting program. \n')
sys.exit(-1)