Can I get a technical explanation on the following error

grocery_stocker cdalten at gmail.com
Sun May 24 19:41:53 CEST 2009


How come something like '\'  causes an error? Here is what I mean.

[cdalten at localhost ~]$ python
Python 2.6.2 (r262:71600, May  3 2009, 17:04:44)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "test \"
  File "<stdin>", line 1
    print "test \"
                 ^
SyntaxError: EOL while scanning string literal
>>>

I mean, isn't the '\' a character just like the letter 't'?



More information about the Python-list mailing list