Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-31 Thread John Machin
Ivan Zuzak wrote: > Joel Hedlund wrote: > > > Yes indeed! But the path to the module will not be the same as the path to > > the script if you are currently in an imported module. Consider this: > > I thought that was the point - to get the full path of the running > script? I see you use the term

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-31 Thread Ivan Zuzak
Joel Hedlund wrote: > Yes indeed! But the path to the module will not be the same as the path to > the script if you are currently in an imported module. Consider this: I thought that was the point - to get the full path of the running script? I see you use the terms "script" and "module" in dif

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-31 Thread Joel Hedlund
> Running "python test.py" now prints /path/to/my_module.py, not > /path/to/my_script.py. That should have been "python my_script.py". Sorry for the slip-up. Cheers! /Joel -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-31 Thread Joel Hedlund
>> How can I find where exactly the current python script is running? > > Doesnt __file__ attribute of each module contain the full filepath of > the module? > Yes indeed! But the path to the module will not be the same as the path to the script if you are currently in an imported module. Cons

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-30 Thread Ivan Zuzak
gmax2006 wrote: > Hi, > > I use RedHat linux. > > How can I find where exactly the current python script is running? Hi, Doesnt __file__ attribute of each module contain the full filepath of the module? So, try this: filepath = __file__ print filepath Works for me :) Cheers, i. zuzak -- htt

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread Eyal Lotem
>> How can I find where exactly the current python script is running? >> ... >> That means sys.argv[0] doesn't always contain the full path of >> running script. > sys.path[0] is the script directory, combined with sys.argv[0] you can > find the full path to th

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread Miki
Hello Max, > How can I find where exactly the current python script is running? > ... > That means sys.argv[0] doesn't always contain the full path of > running script. sys.path[0] is the script directory, combined with sys.argv[0] you can find the full path to the script. (Note

sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread gmax2006
That means sys.argv[0] doesn't always contain the full path of running script. Any help would be appreciated, Max -- http://mail.python.org/mailman/listinfo/python-list