Thanks - just what I needed (and thanks to all the others too) Elisha
On Thu, Jun 18, 2009 at 12:48 PM, Dave Angel <da...@ieee.org> wrote: > bob gailer wrote: > > Elisha Rosensweig wrote: >> >>> > Hi, >>> > >>> > How can I determine the directory in which a module is located, from > >>> within that module? >>> >>> >> sys.modules[__name__].__file__ >> -- Bob Gailer >> > Or more simply, > __file__ > > But the OP wanted the directory, which can be extracted with method > dirname: > > import os > print __file__ > print os.path.dirname(__file__) > > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor