In article <mailman.605.1235434737.11746.python-l...@python.org>, Rhodri James <rho...@wildebst.demon.co.uk> wrote: > >Just so that we're clear, this is a *really* *bad* habit to get into. >Not appending to sys.path, though that isn't often a good idea, but >failing to escape your backslashes. This works because '\D' happens >not to be a valid escape sequence: if your directory had instead been >called "newtypes" then "C:\newtypes" would not have had the result you >were expecting at all. If you really mean a backslash to be in any >literal string, you should always double it: > >sys.path.append("C:\\DataFileTypes")
My preference: sys.path.append(r"C:\DataFileTypes") This doesn't work if you need to add a trailing backslash, though. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "All problems in computer science can be solved by another level of indirection." --Butler Lampson -- http://mail.python.org/mailman/listinfo/python-list