Try the following:
    import os.path
    os.path.abspath(__file__)
This won't work in an interactive shell since it is not being executed from 
within a module.
--
~ Matthew Strax-Haber
National Aeronautics and Space Administration
Langley Research Center (LaRC)
Co-op, Safety-Critical Avionics Systems Branch
Student, Northeastern University
W: 757-864-7378; C: 561-704-0029
matthew.strax-ha...@nasa.gov


________________________________
From: Elisha Rosensweig <bensha...@gmail.com>
Reply-To: <bensha...@gmail.com>
Date: Thu, 18 Jun 2009 11:17:56 -0500
To: Python Tutor <tutor@python.org>
Subject: [Tutor] reference to directory a module is located at

Hi,

How can I determine the directory in which a module is located, from within 
that module?

Elisha

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to