On May 8, 3:54 pm, HMS Surprise <[EMAIL PROTECTED]> wrote:
> Tried executing os.chdir("c:\twill") from a python Tk shell and got
> the error message:
>
> WindowsError: [Error 123] The filename, directory name, or volume
> label syntax is incorrect: 'c:\twill'.
>
> I have the directory exists as I copied the name from the explorer
> window that was open to it.
>
> What is wrong with the syntax?
>
> thanks,
>
> jh


Use
os.chdir(r"c:\twill")
instead.

The "\t" character is the escape character for a tab. You can avoid
such a faux pas by using the raw string construct of the form r"some
string". Otherwise, any backslashes in in your string will be
interpreted as escape characters.

-Basilisk96

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to