os.chdir

Michael Wieher michael.wieher at gmail.com
Fri Mar 7 17:38:24 EST 2008


2008/3/7, Maryam Saeedi <saeed008 at umn.edu>:
>
> I have a problem using os.chdir on linux. What should I do if I want to
> change to root directory? The below does not work:
>
> os.chdir("~/dir1")
>
> Thanks
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>>> os.getcwd()
'/home/michael'
>>> os.chdir("/home/")
>>> os.getcwd()
'/home

I guess just be sure your user account has rights to the directory you're
trying to change to and don't screw up the quotes?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080307/805df667/attachment-0001.html>


More information about the Python-list mailing list