On May 7, 3:25 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-05-07, Chris <[EMAIL PROTECTED]> wrote: > > >>>> os.chdir('C:\temp\my test') > > Traceback (most recent call last): > > File "<input>", line 1, in <module> > > WindowsError: [Error 123] The filename, directory name, or volume > > label syntax is incorrect: 'C:\temp\\my test' > > Python strings have \ escapes, such as \t, \n etc. Above you try to go to > > C:<TAB>emp\my test > > and you are lucky that \m is not something special. > > Either escape your back slashes ("C:\\temp\\my test") or use raw strings > (r"C:\temp\my test"). > > Sincerely, > Albert
My personal preference is using backslashes, if it's something quick or if it's something that will be sitting on a server in a dark corner for a long time to just use os.path.join. I've had neither of those 2 break on me. ;) -- http://mail.python.org/mailman/listinfo/python-list