Changing Working Directory in Windows

Terry Reedy tejarex at yahoo.com
Mon Mar 11 10:10:33 EST 2002


<nrk at cmcorp.com> wrote in message
news:3c8cb05d.221547919 at news.earthlink.net...
> I'm brand new to Python.  Can someone tell me how to change a
working
> directory in a script on a Windows system?
>
> What does the pathname specification look like?
> Can I use an absolute path name when referring to a file?

Look at the os and path modules (ntpath for Windows).

Note that you *can* use forward slashes in filenames for the Windows
API functions that you access thru the above two modules.  This avoids
having to worry about doubling backslashes.

You may have problems with the way Windows fiddles with upper/lower
case.

Terry J. Reedy






More information about the Python-list mailing list