how can i detect if a specifics files exist in directory ? example: i want to detect if (.txt) files exist in directory (dir) i tried with this :
import os.path
from os import path
def main():
print ("file exist:"+str(path.exists('guru99.txt')))
print ("File exists:" + str(path.exists('career.guru99.txt')))
print ("directory exists:" + str(path.exists('myDirectory')))
if __name__== "__main__":
main()
but all this functions you must to insert the complete file name with format(.txt)
Thank you !