Open a file from PYTHONPATH
<p>In a program, and obviously being influenced by the way Java does things, I want to read a static file (a log configuration file, actually) from a directory within the interpreter's PYTHONPATH. I know I could do something like:</p>



<pre class="lang-python prettyprint-override"><code>import foo
a = foo.__path__
conf = open(a[0] + "/logging.conf")
</code></pre>

<p>but I don't know if this is the "Pythonic" way of doing things. How could I distribute the logging configuration file in a way that my application does not need to be externally configured to read it?</p>
