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
[email protected]


________________________________
From: Elisha Rosensweig <[email protected]>
Reply-To: <[email protected]>
Date: Thu, 18 Jun 2009 11:17:56 -0500
To: Python Tutor <[email protected]>
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  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to