Martin M. wrote:
> So how can I do this? In AppleScript I would try something like "path
> to me", but this does not work for imported scripts in AppleScript, as
> you then only get the path to the main script. But can this be done in
> Python? Can modules know where they are currently located, where they
> live? Can they be self-aware?

Yes, they can be:

[EMAIL PROTECTED] ~ $ cat test.py
import os

print os.path.abspath(__file__)
[EMAIL PROTECTED] ~ $ python test.py
/home/modelnine/test.py
[EMAIL PROTECTED] ~ $

HTH!

--- Heiko.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to