On 3 Nov, 15:46, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Sat, 03 Nov 2007 10:07:10 -0300, Giampaolo Rodola' <[EMAIL PROTECTED]>  
> escribió:
>
> > On 3 Nov, 04:21, klenwell <[EMAIL PROTECTED]> wrote:
> >> In PHP you have the __FILE__ constant which gives you the value of the
> >> absolute path of the file you're in (as opposed to the main script
> >> file.)
> > This is not really 'one-line' since you have to import two modules
> > first, but it looks nicer...:
>
> > import sys, os
> > print sys.argv[0] # absolute file name
> > print os.path.dirname(sys.argv[0]) # absolute dir name
>
> Note that this returns the location of the *main* script, not the current  
> module, as the OP explicitely asked for.
>
> --
> Gabriel Genellina

Whoops! You're right.

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

Reply via email to