title: How to open text files in python directly?
body: <p>I have a python script like this:</p>
  
  <pre><code>#I'm treating with text files
  input = str(raw_input('Name1: '))
  output = str(raw_input('Name2: '))
  
  inputFile = open(input, 'r')
  outputFile = open(output, 'w')
  
  def doSomething():
  
      #read some lines of the input
      #write some lines to the output file
  
  inputFile.close()
  outputFile.close()
  </code></pre>
  
  <p>So, you have to put the name of the input file and the name of the output after you call the script in a shell:</p>
  
  <pre><code>python script.py
  </code></pre>
  
  <p>But I wonder if it's possible to call directly the input file and set the name of the output file by the time I'm calling the script, so the syntax of the calling will be something like:</p>
  
  <pre><code>python script.py inputFile.txt outputFile.txt
  </code></pre>
  
  <p>Then, it makes the same than the other, but without using the raw_input method.
  How can I make this?</p>