title: Multiple files for one argument in argparse Python 2.7
body: <p><strong>Trying to make an argument in argparse where one can input several file names that can be read.</strong>
  In this example, i'm just trying to print each of the file objects to make sure it's working correctly but I get the error:</p>
  
  <pre><code>error: unrecognized arguments: f2.txt f3.txt
  </code></pre>
  
  <p><strong>.  How can I get it to recognize all of them?</strong> </p>
  
  <p>my command in the terminal to run a program and read multiple files</p>
  
  <pre><code>python program.py f1.txt f2.txt f3.txt
  </code></pre>
  
  <p>Python script</p>
  
  <pre><code>import argparse
  
  def main():
      parser = argparse.ArgumentParser()      
      parser.add_argument('file', nargs='?', type=file)
      args = parser.parse_args()
  
      for f in args.file:
          print f
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>I used <code>nargs='?'</code> b/c I want it to be any number of files that can be used . If I change <code>add_argument</code> to:</p>
  
  <pre><code>parser.add_argument('file', nargs=3)
  </code></pre>
  
  <p>then I can print them as strings but I can't get it to work with '?'</p>