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.
'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.