title: How to parse command line arguments in Python?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong> <br/>
    <a href="https://stackoverflow.com/questions/20063/whats-the-best-way-to-grab-parse-command-line-arguments-passed-to-a-python-scrip">What&#39;s the best way to grab/parse command line arguments passed to a Python script?</a></p>
  </blockquote>
  
  
  
  <p>I would like to be able to parse command line arguments in my Python 2.6 program.</p>
  
  <p>Ideally, I want to be able to handle these cases:</p>
  
  <pre><code># Show some help
  ./myprogram --help
  
  # These are equivalent
  ./myprogram --block=1
  ./myprogram -b 1
  
  # This means verbose, and twice as verbose:
  ./myprogram -v
  ./myprogram -vv
  </code></pre>