title: Enumerate items in a list so a user can select the numeric value
body: <p>I'm trying to find the most straightforward way to enumerate items in a list so that a user will not be burdened to type a long file name on a command line. The function below shows a user all .tgz and .tar files in a folder ... the user is then allowed to enter the name of the file he wants to extract. This is tedious and syntax-error prone for the user. I would like for a user to just select, say, a numeric value associated with the file (eg.. 1, 2, 3 etc.). Can someone give me some direction on this? Thanks!</p>
  
  <pre><code>  dirlist=os.listdir(path)
  
    def show_tgz():
       for fname in dirlist:
            if fname.endswith(('.tgz','.tar')):
               print '\n'
               print fname
  </code></pre>