title: How to read multiple command line parameters with same flag in Python?
body: <p>A user should be able to call the Python script like this:</p>
  
  <pre><code>python myScript.py -i inputFile.txt -k string1 -k string2 -k string3 -o outputFile.txt
  </code></pre>
  
  <p>or like this:</p>
  
  <pre><code>python myScript.py -i inputFile.txt -o outputFile.txt -k string1 -k string2
  </code></pre>
  
  <p>Inside the script, I want to end up reading in the "-i" parameter, the "-o" parameter, and put all the "-k" parameters (variable amount) into an ordered list.</p>
  
  <p>I want to do this in a clean way (I know I can write this myself from scratch, but I would rather use an already-built library/module).</p>
  
  <p>I must use Python 2.4.3 and would like to use getopt (if not something similar). I am not allowed to download argparse either.</p>