title: Python: Need to add chosen filenames into an array
body: <p>The idea is simple: there is a directory with 2 or more files *.txt. My script should look in the directory and get filenames in order to copy them (if they exist) over the network.
  As a Python newbie, I am facing problems which cannot resolve so far.
  My code:</p>
  
  <pre><code>files = os.listdir('c:\\Python34\\');
  for f in files:
      if f.endswith(".txt"):
      print(f)
  </code></pre>
  
  <p>This example returns 3 files:</p>
  
  <pre><code>LICENSE.txt
  NEWS.txt
  README.txt
  </code></pre>
  
  <p>Now I need to use every filename in order to do a SCP. The problem is that when I try to get the first filename with:</p>
  
  <pre><code>print(f[0])
  </code></pre>
  
  <p>I am receiving just the first letters from each file in the list:</p>
  
  <pre><code>L
  N
  R
  </code></pre>
  
  <p>How to add filenames to an array in order to use them later as a array elements?</p>