[Tutor] An old newbies "escape sequence" confusion

Nick Lunt nick at javacat.f2s.com
Fri Sep 10 13:37:39 CEST 2004


Hi,

it appears to be an issue with 'idle'.

Have you tried it with pythonwin http://www.python.org/windows/pythonwin/ ?

Here's what I get with idle:


>>> l = ['\a','\b','\f','\r','\w']
>>> l
['\x07', '\x08', '\x0c', '\r', '\\w']
>>> for i in l:
 print i







\w
>>>


and here's what I get with pythonwin:

>>> l = ['\a','\b','\f','\r','\w']
>>> l
['\x07', '\x08', '\x0c', '\r', '\\w']
>>> for i in l:
...  print i
...
BEL
BS
FF

\w
>>>

I had to write in the BEL, BS and FF sequences cos outlook turned them into
squares, same as idle did.

Hope that helps a bit
Nick.

  -----Original Message-----
  From: tutor-bounces at python.org [mailto:tutor-bounces at python.org]On Behalf
Of Q852913745 at aol.com
  Sent: 10 September 2004 12:18
  To: tutor at python.org
  Subject: [Tutor] An old newbies "escape sequence" confusion


  I am just beginning to learn Python from:
  "Python programming for the absolute beginner"

  In the first few pages I am already confused.
  The following escape sequences do not appear to be recognised
  \a  \b  \f  \r  \v  they all produce a small square on the screen.

  I have tried the version of Python supplied with the book,
Python-2.2.3.exe
  and have also tried Python-2.3.4.exe. I am installing on Windows XP Home,
both produce the same results even when pasting source code samples supplied
from the book cd.

  I am "just" beginning so simple answers would be appreciated!


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.759 / Virus Database: 508 - Release Date: 09/09/2004
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040910/cb7ea0c4/attachment.html


More information about the Tutor mailing list