"EOL while scanning single-quoted string", what is the meaning?

Discussion in 'Python' started by excite, Nov 2, 2006.

  1. excite

    excite

    Joined:
    Nov 2, 2006
    Messages:
    2
    Likes Received:
    0
    I am trying to write a long string into a txt file, the string includes some backslash, looks like:
    'd:\#########\#######\####### d:\######\####\####\### d:\###\###\'
    then I got a error saying 'EOL while scanning single-quoted string'. But it works when I just delete the last backslash or add one more backslash in the end. I found a previous post is about this problem, and it is said that usually the backslash should be represented as '\\', but in my case, why there is no error when I use single backslash for the first several ones, and the error only happened to the last single backslash.
    Can someone tell me what is the meaning of this error, and how to handle this problem? Thanks.
     
    excite, Nov 2, 2006
    #1
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.