title: How to create a list from filenames in a user specified directory in Python?
body: <p>I want to create a new list in Python from filenames in a user defined directory .</p>
  
  <p>I can't quite get my head around the subprocess syntax from the wiki and some of the commands using PIPE seem to be discouraged. </p>
  
  <p>So I'd prompt to define which directory to load from:</p>
  
  <p><code>directory = raw_input("Path to directory: ")</code></p>
  
  <p>Then run <code>subprocess.check_output(["ls", "*eg*.txt"])</code> in the specified directory and place the output into <code>list1</code>.</p>