How to get full path to script?

bukzor workitharder at
Mon Jun 9 07:37:34 CEST 2008

On Jun 8, 12:52 pm, kj <so... at> wrote:
> In <Bu2dnUy5AvRQtdHVnZ2dnUVZ_tqdn... at> "Mark Tolonen" <M8R-yft... at> 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.

More information about the Python-list mailing list