title: Python 3.x call function with sys.argv[]
body: <p>I have a function that processes file contents, but right now I have the filename hardcoded in the function like this as a keyword argument:</p>
  
  <pre><code>def myFirstFunc(filename=open('myNotes.txt', 'r')): 
      pass
  </code></pre>
  
  <p>and I call it like this:</p>
  
  <pre><code>myFirstFunc()
  </code></pre>
  
  <p>I would like to treat the argument as a filename and process the contents.</p>
  
  <ol>
  <li><p>How do I modify the statement above?  I tried this:</p>
  
  <pre><code>filename=sys.argv[1]  # or is it 0?
  </code></pre></li>
  <li><p>How do I call it? </p></li>
  </ol>