python search module path script with arguments not working
<p>To find a module's path, I would like to use the following script:</p>

<pre><code>import &lt;module_name&gt;
print &lt;module_name&gt;.__file__
</code></pre>

<p>It works.</p>

<p>However, I want to make it more flexible, to receive an argument to specify the module's name.</p>

<p>If I name the script as searchModulePath.py, I want to run it with <code>searchModulePath.py &lt;some_module_name&gt;</code>.</p>

<p>Here is what I have tried:</p>

<pre><code>#!usr/bin/python

import sys
print sys.argv
import sys.argv[1]
print sys.argv[1].__file__
</code></pre>

<p>But it doesn't work:</p>

<pre><code>  File "searchModulePath.py", line 5
    import sys.argv[1]
                   ^
SyntaxError: invalid syntax
</code></pre>

<p>And, the print statement in the 2nd line doesn't print out anything, :(</p>

<p>Anything I missed here?</p>
