Python: Compare sys.argv with a string
<p>This seems like it should be so simple, but i am having some serious issues. All i want to do is see if the user input matches a 2 letter expression. I guess my biggest problem i have is that i am not very familiar with the re library and the documentation does not really help me too much.</p>

<p>This is what i have tried so far:</p>

<p>try 1</p>

<pre><code>if re.match(sys.argv[3],  "GL",  re.I):
    input_file_path = "V:\\test"
</code></pre>

<p>try 2</p>

<pre><code>if re.ignorecase(sys.argv[3],  "GL"):
    input_file_path = "V:\\test"
</code></pre>

<p>try 3</p>

<pre><code>if sys.argv[3] == "GL":
    input_file_path = "V:\\test"
</code></pre>

<p>The way i call the program to run: filename.py tester test GL
"tester" and "test" are not really used yet.</p>

<p>EDIT: I found my main problem. I was calling a bunch of if statements rather than elif. So the last one that said else: exit() always got hit (cause i was testing the first if). rookie mistake</p>
