title: how to read a txt passed by command line argument
body: <p>i want to pass a txt file by command line argument using the argparse module and read the file with <code>open()</code> function but first thing i've encountred was this error : </p>
  
  <pre><code>AttributeError: 'dict' object has no attribute 's'
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre class="lang-py prettyprint-override"><code>import argparse
  parser = argparse.ArgumentParser(description="My program!", formatter_class=argparse.RawTextHelpFormatter)
  parser.add_argument("-s", type=argparse.FileType('r'), help="Filename/path to be passed")
  args = vars(parser.parse_args())
  subfile = (open(args.s, "r")).read()
  </code></pre>