Re: argv[0] and __file__ inconsistency

2007-12-31 Thread Benjamin M. A'Lee
On Mon, Dec 31, 2007 at 02:31:39PM -0800, Hai Vu wrote: > I currently use ActivePython 2.5.1. Consider the following code which > I saved as cmdline.py: > import sys > print sys.argv[0] > If I invoke this code as 'python cmdline.py', then the output is: > cmdline.py > If I invoke it as

Re: argv[0] and __file__ inconsistency

2007-12-31 Thread Hai Vu
> use os.path.abspath Bingo! This is just what the doctor ordered. Thank you. Hai -- http://mail.python.org/mailman/listinfo/python-list

Re: argv[0] and __file__ inconsistency

2007-12-31 Thread John Machin
On Jan 1, 9:31 am, Hai Vu <[EMAIL PROTECTED]> wrote: > I currently use ActivePython 2.5.1. Consider the following code which > I saved as cmdline.py: > import sys > print sys.argv[0] > If I invoke this code as 'python cmdline.py', then the output is: > cmdline.py > If I invoke it as 'cm

argv[0] and __file__ inconsistency

2007-12-31 Thread Hai Vu
I currently use ActivePython 2.5.1. Consider the following code which I saved as cmdline.py: import sys print sys.argv[0] If I invoke this code as 'python cmdline.py', then the output is: cmdline.py If I invoke it as 'cmdline.py', then the output is: C:\Users\hai\src\python\cmdline.