Invalid syntax error

D'Arcy J.M. Cain darcy at druid.net
Sun Dec 20 10:55:54 EST 2009


On Sun, 20 Dec 2009 08:40:05 -0500
"Ray Holt" <mrholtsr at sbcglobal.net> wrote:
> Why am I getting an invalid syntax error on the following:
> os.chdir(c:\\Python_Modules). The error message says the colon after c is

You forgot the quotes around the string.  I am not on Windows but I
think the following will all work.

os.chdir("c:\\Python_Modules")
os.chdir(r"c:\Python_Modules")
os.chdir("c:/Python_Modules")

I won't swear to that last one but other languages handle it.  Try them.

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list