chdir questions

Evan Simpson evan at
Sun Feb 6 13:13:50 EST 2000

Patrick K Moorman <khadji at> wrote in message
news:Bmin4.4589$NS3.14557 at
> I know this is must be an easy one but how do I use os.chdir?  I have
> many different ways of listing the path but no matter how I type it I get
> error.  Most common is either:
> >>> os.chdir(C:\temp)
>   File "<string>", line 1
>      os.chdir(C:\temp)

Is your previous experience coding with shell scripts or a language like
Rebol?  You will need to adjust some of your basic concepts for Python.

In Python you need to put quotes around text which is not a keyword or a
name for a Python object.  Also, backslashes ('\') are used to "escape" the
next character, so '\t' is a tab character.  Fortunately, Python file
functions accept forward-slashed filenames on all platforms.

For the above you would write either:



Evan @ digicool

More information about the Python-list mailing list