how to detect file if exist in python : <p>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 :</p>

<pre><code>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()
</code></pre>

<p>but all this functions you must to insert the complete file name with format(.txt)</p>

<p>Thank you !</p>
