title: How to run script for all files in a folder/directry
body: <p>I am new to python. I have successful written a script to search for something within a file using :</p>
  
  <p><code>open(r"C:\file.txt)</code> and <code>re.search</code> function and all works fine.</p>
  
  <p>Is there a way to do the search function with all files within a folder? Because currently, I have to manually change the file name of my script by  <code>open(r"C:\file.txt),</code>open(r"C:\file1.txt)<code>,</code>open(r"C:\file2.txt)`, etc.</p>
  
  <p>Thanks.</p>