>>> import imp<br>>>> imp.find_module("os")<br>(<open file '/usr/lib/python2.7/os.py', mode 'U' at 0xb6c4c700>, '/usr/lib/python2.7/os.py', ('.py', 'U', 1))<br>
>>> <br><br><div class="gmail_quote">2011/12/23 Gnarlodious <span dir="ltr"><<a href="mailto:gnarlodious@gmail.com">gnarlodious@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Given a module's name, how do I get the file path without importing it? Searched all over, can't find any such info.<br>
<br>
Is it possible to ask if a named module exists before attempting an import?<br>
<br>
Or are we forced to import first and catch any failure?<br>
<br>
-- Gnarlie<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><a href="http://yasar.serveblog.net/" target="_blank">http://yasar.serveblog.net/</a><br><br>