Re: Invalid syntax error

Discussion in 'Python' started by D'Arcy J.M. Cain, Dec 20, 2009.

  1. On Sun, 20 Dec 2009 08:40:05 -0500
    "Ray Holt" <> 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 <> | 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.
    D'Arcy J.M. Cain, Dec 20, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWFyayBQaGFuaWRlcw==?=

    Intermittant redirect to Invalid Syntax Error page

    =?Utf-8?B?TWFyayBQaGFuaWRlcw==?=, Feb 16, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    489
    =?Utf-8?B?TWFyayBQaGFuaWRlcw==?=
    Feb 16, 2004
  2. Patrick.O.Ige
    Replies:
    1
    Views:
    1,952
    Patrick.O.Ige
    Jul 2, 2006
  3. py
    Replies:
    2
    Views:
    411
  4. Tim Golden

    RE: WMI - invalid syntax error?

    Tim Golden, Dec 30, 2005, in forum: Python
    Replies:
    1
    Views:
    520
  5. Mark Richards
    Replies:
    3
    Views:
    309
    Tad McClellan
    Nov 18, 2007
Loading...

Share This Page