On Mon, Jun 9, 2008 at 12:37 AM, bukzor <[EMAIL PROTECTED]> wrote:
> On Jun 8, 12:52 pm, kj <[EMAIL PROTECTED]> wrote:
>> In <[EMAIL PROTECTED]> "Mark Tolonen" <[EMAIL PROTECTED]> writes:
>>
>> >import os
>> >print os.path.abspath(__file__)
>>
>> Great.  Thanks!
>>
>> Kynn
>>
>> --
>> NOTE: In my address everything before the first period is backwards;
>> and the last period, and everything after it, should be discarded.
>
> Note that this doesn't quite work for symbolic links or compiled
> scripts, depending on your requirements.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

For my compiled scripts, I usually use this variation:

path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0])))

It's always worked for me.

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

Reply via email to