Getting original working directory

Ian Clark iclark at mail.ewu.edu
Thu Sep 6 14:30:14 EDT 2007


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 to 2 and then wanting to know what the original value is. It 
just ain't gonna happen.

Simply follow the advice given by Gary and use os.getcwd() *before* the 
call to os.chdir().

Ian




More information about the Python-list mailing list