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 create a new module that does the os.getcwd() then call the module that you cannot change. Also I do not agree that such thing is not possible because after python > script finishes its work, it naturally gets back into the original location > from where you started the script (in shell you are in the original location > after script finishes). So this information has to be stored somewhere > (probably in shell which runs the interpreter) and there *must* be a way > how to get 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. > The shell is back to where it started for a very different reason. I won't go into it, because it's not about Python. However, if you know what shell you will *always* be using to run the script, then there may be a way. Bash, for example, will have the path where you were when the script started in os.environ['PWD']. I suspect most shells have something similar. David -- http://www.traceback.org
-- http://mail.python.org/mailman/listinfo/python-list