How to get full path to script?
workitharder at gmail.com
Mon Jun 9 07:37:34 CEST 2008
On Jun 8, 12:52 pm, kj <so... at 987jk.com.invalid> wrote:
> In <Bu2dnUy5AvRQtdHVnZ2dnUVZ_tqdn... at comcast.com> "Mark Tolonen" <M8R-yft... at mailinator.com> writes:
> >import os
> >print os.path.abspath(__file__)
> Great. Thanks!
> 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