title: Pass arguments from cmd to python script
body: <p>I write my scripts in python and run them with cmd by typing in:</p>
  
  <pre><code>C:\&gt; python script.py
  </code></pre>
  
  <p>Some of my scripts contain separate algorithms and methods which are called based on a flag.
  Now I would like to pass the flag through cmd directly rather than having to go into the script and change the flag prior to run, I want something similar to:</p>
  
  <pre><code>C:\&gt; python script.py -algorithm=2
  </code></pre>
  
  <p>I have read that people use sys.argv for almost similar purposes however reading the manuals and forums I couldn't understand how it works.</p>