#!/usr/bin/python # module show_my_path # ... import os print 'os.path.abspath(__file__):', os.path.abspath(__file__) # ... # end of module
[EMAIL PROTECTED] class]$ python >>> import show_my_path os.path.abspath(__file__): /misc/proc/py/test/class/show_my_path.py >>> [EMAIL PROTECTED] class]$ python show_my_path.py os.path.abspath(__file__): /misc/proc/py/test/class/show_my_path.py -- http://mail.python.org/mailman/listinfo/python-list