text files in a Dir and store the file names in a list python
<p>I am trying to grab all of the text files in a Dir and store the file names in a list so i can send them to a method that runs some Photoshop on the files and exports them in a different format. </p>

<p>This for some reason my counter (count) is giving me an output of 12 (the numbers of characters in the file name :( am i storing the list improperly?</p>

<pre><code>    import win32com.client
    import os
    def GetFolder():
   file = open('C:\\appData\\File.txt')
   string = file.readlines()
   path = string[0]
   dirListing = os.listdir(path)
   editFiles = []
   for item in dirListing:
    if ".txt" in item:
        editFiles = item
   count = len(editFiles)
   catch = 0
   print "count= " 
   print count 
   print "Catch= " 
   print catch
   print editFiles
   print '----------------------------------------- 

       while catch &lt;= count:
     print editFiles
     catch +=1
</code></pre>

<p>i am going to loop threw the method it the while loop </p>

<p>Output</p>

<pre><code> count=
 12
 Catch=
 0
 TextFile.txt
 -----------------------------------------
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
 TextFile.txt
</code></pre>
