Does os.getcwd() and os.curdir have the same effect ?
iMath
redstone-cold at 163.com
Thu Sep 27 02:26:30 EDT 2012
On Sunday, September 9, 2012 9:39:28 PM UTC+8, Thomas Jollans wrote:
> On 09/09/2012 03:22 PM, iMath wrote: > Does os.getcwd() and os.curdir have the same effect ? > Python 3.2.3 (default, May 3 2012, 15:51:42) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.getcwd() '/home/tjol' >>> os.curdir '.' >>> No. Both refer to the current directory, but os.curdir is not an absolute path, so you can't chdir() to it later and expect to land it the original directory.
get it ,thanks
More information about the Python-list
mailing list