RE: Escapeism

2006-10-03 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Matthew Warren > Sent: 03 October 2006 16:07 > To: python-list@python.org > Subject: RE: Escapeism > > > > > -Original Message- > &

RE: Escapeism

2006-10-03 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Kay Schluehr > Sent: 30 September 2006 18:02 > To: python-list@python.org > Subject: Re: Escapeism > > Sybren Stuvel wrote: > > Kay Schluehr enlightened

Re: Escapeism

2006-10-01 Thread Fredrik Lundh
Hendrik van Rooyen wrote: > dumb question - is the backslash as escape character fixed yes. > seems to me that would help help with what? > or if you could turn the behaviour off - don't know how though... eh? if you don't want to use repr(), you don't have to. -- http://mail.python.org

Re: Escapeism

2006-10-01 Thread Fredrik Lundh
Kay Schluehr wrote: > This yields the hexadecimal representation of the ASCII character and > does not simply echo the keystrokes '\' and 'a' for '\a' ignoring the > escape semantics. One way to achieve this naturally is by prefixing > '\a' with r where r'\a' indicates a "raw" string. But unfortun

Re: Escapeism

2006-10-01 Thread Hendrik van Rooyen
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: > Sybren Stuvel wrote: > > Kay Schluehr enlightened us with: > > > Usually I struggle a short while with \ and either succeed or give up. > > > Today I'm in a different mood and don't give up. So here is my > > > question: > > > > > > You have an unknown c

Re: Escapeism

2006-10-01 Thread Kay Schluehr
Frederic Rentsch wrote: > Kay Schluehr wrote: > > Sybren Stuvel wrote: > > > >> Kay Schluehr enlightened us with: > >> > >>> Usually I struggle a short while with \ and either succeed or give up. > >>> Today I'm in a different mood and don't give up. So here is my > >>> question: > >>> > >>> You ha

Re: Escapeism

2006-10-01 Thread Frederic Rentsch
Kay Schluehr wrote: > Sybren Stuvel wrote: > >> Kay Schluehr enlightened us with: >> >>> Usually I struggle a short while with \ and either succeed or give up. >>> Today I'm in a different mood and don't give up. So here is my >>> question: >>> >>> You have an unknown character string c suc

Re: Escapeism

2006-09-30 Thread Steve Holden
Kay Schluehr wrote: > Steve Holden wrote: > >>Kay Schluehr wrote: >> >>>Sybren Stuvel wrote: >>> >>> Kay Schluehr enlightened us with: >Usually I struggle a short while with \ and either succeed or give up. >Today I'm in a different mood and don't give up. So here is my >

Re: Escapeism

2006-09-30 Thread Leonhard Vogt
> But there is some ambiguity due to the the fact that applying '\7' to > rawform() yields r'\a' and not r'\7'. So one needs more specification > for disambiguation using e.g. an extra parameter. > >>> '\a'=='\7' True The two are actually the same thing, so how could a function decide whether to

Re: Escapeism

2006-09-30 Thread Kay Schluehr
Steve Holden wrote: > Kay Schluehr wrote: > > Sybren Stuvel wrote: > > > >>Kay Schluehr enlightened us with: > >> > >>>Usually I struggle a short while with \ and either succeed or give up. > >>>Today I'm in a different mood and don't give up. So here is my > >>>question: > >>> > >>>You have an unk

Re: Escapeism

2006-09-30 Thread Steve Holden
Kay Schluehr wrote: > Sybren Stuvel wrote: > >>Kay Schluehr enlightened us with: >> >>>Usually I struggle a short while with \ and either succeed or give up. >>>Today I'm in a different mood and don't give up. So here is my >>>question: >>> >>>You have an unknown character string c such as '\n' ,

Re: Escapeism

2006-09-30 Thread Duncan Booth
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: >> try "print repr(c)". > > This yields the hexadecimal representation of the ASCII character and > does not simply echo the keystrokes '\' and 'a' for '\a' ignoring the > escape semantics. But you yourself noted earlier that '\a' and '\x07' are the same

Re: Escapeism

2006-09-30 Thread Kay Schluehr
Sybren Stuvel wrote: > Kay Schluehr enlightened us with: > > Usually I struggle a short while with \ and either succeed or give up. > > Today I'm in a different mood and don't give up. So here is my > > question: > > > > You have an unknown character string c such as '\n' , '\a' , '\7' etc. > > > >

Re: Escapeism

2006-09-30 Thread Sybren Stuvel
Kay Schluehr enlightened us with: > Usually I struggle a short while with \ and either succeed or give up. > Today I'm in a different mood and don't give up. So here is my > question: > > You have an unknown character string c such as '\n' , '\a' , '\7' etc. > > How do you echo them using print? >

Re: Escapeism

2006-09-30 Thread Peter Otten
Kay Schluehr wrote: > Usually I struggle a short while with \ and either succeed or give up. > Today I'm in a different mood and don't give up. So here is my > question: > > You have an unknown character string c such as '\n' , '\a' , '\7' etc. > > How do you echo them using print? > > print_st

Escapeism

2006-09-30 Thread Kay Schluehr
Usually I struggle a short while with \ and either succeed or give up. Today I'm in a different mood and don't give up. So here is my question: You have an unknown character string c such as '\n' , '\a' , '\7' etc. How do you echo them using print? print_str( c ) prints representation '\a' to st