Re: Can I get a technical explanation on the following error

2009-05-25 Thread Piet van Oostrum
> Jim Garrison (JG) wrote: >JG> And as an interesting exercise, try >JG> print r'test \' >JG> print r'test \\' >JG> Because of the way raw string parsing is defined, neither of these will >JG> pass the parser. In fact, a raw string cannot have a backslash as >JG> its last character. Cannot

Re: Can I get a technical explanation on the following error

2009-05-25 Thread pdpi
On May 24, 6:41 pm, grocery_stocker wrote: > How come something like '\'  causes an error? Here is what I mean. > > [cdal...@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

Re: Can I get a technical explanation on the following error

2009-05-25 Thread Niklas Norrthon
On 25 Maj, 05:29, Jim Garrison wrote: > And as an interesting exercise, try > > print r'test \' > print r'test \\' > > Because of the way raw string parsing is defined, neither of these will > pass the parser.  In fact, a raw string cannot have a backslash as > its last character. Tried it: >>> r

Re: Can I get a technical explanation on the following error

2009-05-25 Thread Chris Rebert
On Sun, May 24, 2009 at 1:14 PM, grocery_stocker wrote: > On May 24, 11:47 am, Hans Müller wrote: >> Try this: >> >> print "\\" >> >> \ is the escape character, it masks the meaning of the next chararcter. >> >> If you write print "\" python tries to print " (the meaning of " as >> the string del

Re: Can I get a technical explanation on the following error

2009-05-24 Thread Jim Garrison
And as an interesting exercise, try print r'test \' print r'test \\' Because of the way raw string parsing is defined, neither of these will pass the parser. In fact, a raw string cannot have a backslash as its last character. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I get a technical explanation on the following error

2009-05-24 Thread Rhodri James
On Sun, 24 May 2009 21:14:44 +0100, grocery_stocker wrote: On May 24, 11:47 am, Hans Müller wrote: Try this: print "\\" \ is the escape character, it masks the meaning of the next chararcter. If you write print "\" python tries to print " (the meaning of " as the string delimiter is beei

Re: Can I get a technical explanation on the following error

2009-05-24 Thread grocery_stocker
On May 24, 11:47 am, Hans Müller wrote: > Try this: > > print "\\" > > \ is the escape character, it masks the meaning of the next chararcter. > > If you write print "\" python tries to print " (the meaning of " as > the string delimiter is beeing masked) and finds no closing " > This is why you g

Re: Can I get a technical explanation on the following error

2009-05-24 Thread Hans Müller
Try this: print "\\" \ is the escape character, it masks the meaning of the next chararcter. If you write print "\" python tries to print " (the meaning of " as the string delimiter is beeing masked) and finds no closing " This is why you got the error. hth. Greetings Hans -- http://mail.pyth

Re: Can I get a technical explanation on the following error

2009-05-24 Thread DasIch
'\' starts a escape sequence. You need to escape '\' with a '\' to make it work. >>> print 'test \\' test \ -- http://mail.python.org/mailman/listinfo/python-list

Can I get a technical explanation on the following error

2009-05-24 Thread grocery_stocker
How come something like '\' causes an error? Here is what I mean. [cdal...@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 "", l