Re: Newbie need help
From: Scott David Daniels (Scott.Daniels_at_Acm.Org)
Date: 04/06/04
- Next message: Tuure Laurinolli: "Re: Session variables?"
- Previous message: Sean Berry: "FDF to PDF in Python?"
- Maybe in reply to: Cameron Laird: "Re: Newbie need help"
- Next in thread: Dang Griffith: "Re: Newbie need help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 05 Apr 2004 15:04:00 -0700
Tony Ha wrote:
> ... instead of
>os.chdir("C:\Python23\Lib\site-packages\PythonCardPrototype\tools")
>you need
>os.chdir("C:\\Python23\\Lib\\site-packages\\PythonCardPrototype\\tools\\codeEditor")
> I also found out you can you u' raw string. i.e.
> os.chdir(u'C:\Python23\Lib\site-packages\PythonCardPrototype')
> this also work.
Nope, you just lucked out by using a different string.
the problem with using a backslash is that it normally an instruction to
the source translator to construct special characters. Because your
previous directory name included tools, you had a sequence with a
backslash followed by a lower case t. That is shorthand for a tab
(ASCII 9). As Peter Hansen tells you in another note, you can use
an r directly before the string to tell the source translator to
"treat backslashes as regular characters." So, you'll notice that,
for example, 'abc\tex' != r'abc\tex', but 'abc\Tex' == r'abc\Tex',
because '\t' is the tab character, not '\T'.
-- -Scott David Daniels Scott.Daniels@Acm.Org
- Next message: Tuure Laurinolli: "Re: Session variables?"
- Previous message: Sean Berry: "FDF to PDF in Python?"
- Maybe in reply to: Cameron Laird: "Re: Newbie need help"
- Next in thread: Dang Griffith: "Re: Newbie need help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|