Parsing python command line arguments
<p>Complete newbie question.</p>

<p>I am developing a class for searching a movie database using an API.</p>

<p>Here is how you make a query using the movie title and year from within the Python interpreter:</p>

<pre><code>import moviesearch

movie_db = moviesearch.MovieSearch()
result = movie_db.search('Clockwork Orange', year='1971')
print result
</code></pre>

<p>Doing this particular query yields one result from the service I am using.</p>

<p>To save typing for testing, I have created the following script m.py:</p>

<pre><code>from sys import argv
import moviesearch

script, movie_name, params = argv

movie_db = moviesearch.MovieSearch()
result = movie_db.search(movie_name, params)
print result
</code></pre>

<p>When I execute this script like so:</p>

<pre><code>python m.py 'Clockwork Orange', year='1971'
</code></pre>

<p>the service yields two results.</p>

<p>So this means that there is something wrong with the way I am formatting my parameters when I am testing the class  with the script. Can someone please tell me what I am doing wrong?</p>

<p>I am not including the class for querying the movie database because I don't think that's necessary for figuring out what's wrong. What I need to know is how to properly format my parameters when using the script so that it executes exactly as it does in the example above where I am using the class directly from the Python interpreter. </p>

<p>Thanks in advance for any help. </p>
