Re: Getting original working directory

2007-09-07 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steve Holden wrote: > Python runs as a sub-process. The parent process (the one that started > Python) contains the working directory that the Python interpreter > inherited from it. But you can't expect to just go poking around inside > the environment of your pare

Re: Getting original working directory

2007-09-06 Thread Gabriel Genellina
En Thu, 06 Sep 2007 15:47:02 -0300, rave247 rave247 <[EMAIL PROTECTED]> escribi�: > If I could use os.getcwd() or save the value to some variable before > calling os.chdir() I would do it, believe me. However I can't because it > is the part of code where I can't do any changes. > > Also I d

Re: Getting original working directory

2007-09-06 Thread Ben Finney
Please don't top-post. Instead, trim the parts you're not replying to (preserving the attribution line so we can see who wrote what), and put your reply beneath those, so your message reads in normal chronological order. rave247 rave247 <[EMAIL PROTECTED]> writes: > If I could use os.getcwd() or

Re: Getting original working directory

2007-09-06 Thread rave247 rave247
Yes, I think you are right, without hacking into the parent process it will not work, and this is bad way. I hope I find the better way. Thanks for your comments > Původní zpráva > Od: Steve Holden <[EMAIL PROTECTED]> > Předmět: Re: Getting original wo

Re: Getting original working directory

2007-09-06 Thread Steve Holden
rave247 rave247 wrote: > If I could use os.getcwd() or save the value to some variable before calling > os.chdir() > I would do it, believe me. However I can't because it is the part of code where I > can't do any changes. > > Also I do not agree that such thing is not possible because after p

Re: Getting original working directory

2007-09-06 Thread Gary Herron
n't do it any other way. Gary Herron > Thanks > > > >> Původní zpráva >> Od: Gabriel Genellina <[EMAIL PROTECTED]> >> Předmět: Re: Getting original working directory >> Datum: 06.9.2007 17:35:51 >>

Re: Getting original working directory

2007-09-06 Thread David Stanek
On 9/6/07, rave247 rave247 <[EMAIL PROTECTED]> wrote: > > If I could use os.getcwd() or save the value to some variable before > calling os.chdir() I would do it, believe me. However I can't because it > is the part of code where I can't do any changes. Why is it not possible. If nothing else cre

Re: Getting original working directory

2007-09-06 Thread rave247 rave247
> One of the best portable ones that I've seen used is this: > > os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),'.')) This is not working. Please look at this code: import os import sys x = os.getcwd() os.chdir("\whatever") y = #here I don't know. This code is not working: os.pat

Re: Getting original working directory

2007-09-06 Thread rave247 rave247
it. Simply after calling os.chdir() the original value doen't disappear, I think it just needs some nice hack if python doesn't provide a way how to get it. > Původní zpráva > Od: Ian Clark <[EMAIL PROTECTED]> > Předmět: Re: Getting original working

Re: Getting original working directory

2007-09-06 Thread Ian Clark
rave247 rave247 wrote: > "..the *original* directory location *after* os.chdir() is > performed.." os.getcwd() is not helping much as it returns the location > that was set up in os.chdir() call > > Thanks Your question is akin to having a name X that is bound to some value, setting it

Re: Getting original working directory

2007-09-06 Thread kyosohma
On Sep 6, 10:19 am, rave247 rave247 <[EMAIL PROTECTED]> wrote: > Hi, > > I' am unable to solve this problem. I've got python program, it is installed > in standard location. I run this program from some location X (note that I > just type relative "myscript", leaving operating system to look up s

Re: Getting original working directory

2007-09-06 Thread rave247 rave247
> Předmět: Re: Getting original working directory > Datum: 06.9.2007 17:35:51 > > On 6 sep, 12:19, rave247 rave247 <[EMAIL PROTECTED]> wrote: > > > I' am unable to solve this problem. I've got python program, it is ins

Re: Getting original working directory

2007-09-06 Thread Gary Herron
rave247 rave247 wrote: > Hi, > > I' am unable to solve this problem. I've got python program, it is installed > in standard location. I run this program from some location X (note that I > just type relative "myscript", leaving operating system to look up script > itself using PATH variable) and

Re: Getting original working directory

2007-09-06 Thread Gabriel Genellina
On 6 sep, 12:19, rave247 rave247 <[EMAIL PROTECTED]> wrote: > I' am unable to solve this problem. I've got python program, it is installed > in standard location. I run this program from some location X (note that I > just type relative "myscript", leaving operating system to look up script > i

Getting original working directory

2007-09-06 Thread rave247 rave247
Hi, I' am unable to solve this problem. I've got python program, it is installed in standard location. I run this program from some location X (note that I just type relative "myscript", leaving operating system to look up script itself using PATH variable) and this program somewhere in the cod