Python parse arguments from command line
<p>I have a question regarding passing arguments in Python.for Ex: in the script i am expecting arguments like</p>

<pre><code>1.python run.py -create vairbale1 -reference variable2 many more variables
2.python run.py  -get -list variable many more variable
</code></pre>

<p>How can i enfore this in the script using optparse or getopt and if the arguments are invalid The i need to print Invalid arguments</p>

<pre><code> from optparse import OptionParser

 parser = OptionParser()
</code></pre>
