Thanks - just what I needed (and thanks to all the others too)<br><br>Elisha<br><br><div class="gmail_quote">On Thu, Jun 18, 2009 at 12:48 PM, Dave Angel <span dir="ltr">&lt;<a href="mailto:davea@ieee.org">davea@ieee.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">bob gailer wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Elisha Rosensweig wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; Hi,<br>
&gt;<br>
&gt; How can I determine the directory in which a module is located, from &gt; within that module?<br>
    <br>
</blockquote></div>
sys.modules[__name__].__file__<br>
-- Bob Gailer<br>
</blockquote>
Or more simply,<br>
   __file__<br>
<br>
But the OP wanted the directory, which can be extracted with method dirname:<br>
<br>
import os<br>
print __file__<br>
print os.path.dirname(__file__)<br>
<br>
<br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote></div><br>