printing escape character
hrochonwo at googlemail.com
Tue Jan 22 20:04:21 CET 2008
On Jan 22, 7:58 pm, "Jerry Hill" <malaclyp... at gmail.com> wrote:
> On Jan 22, 2008 1:38 PM, hrochonwo <hrocho... at googlemail.com> wrote:
> > Hi,
> > I want to print string without "decoding" escaped characters to
> > newline etc.
> > like print "a\nb" -> a\nb
> > is there a simple way to do it in python or should i somehow use
> > string.replace(..) function ?
> >>> print 'a\nb'.encode('string_escape')
thank you, jerry
More information about the Python-list