whitespace and ?asc()?

Mike M mmoum at woh.rr.com
Wed Jul 2 01:09:11 CEST 2003


NP = chr(12) = <ctrl-L> = New Page (for printers)

Mike

-- 
--
the Moum's (Mike, Dede, Suzanne, Jeff, Kristen)
Tipp City, Ohio, USA
e-mail: mmoum at woh.rr.com
Learn about the Baha'i Faith at: http://www.bahai.org
Visit the United States Baha'i Site at: http://www.us.bahai.org
"Ray Tomes" <rtomes at ihug.co.nz> wrote in message
news:3F02086D.9010300 at ihug.co.nz...
> Hi all
>
> I am totally new to python. On the whole I really like the design of the
> language and after just one day may be considered a convert.
>
> I was trying to find out the exact definition of whitespace so I went to
> look at strings.whitespace to find out which chars were whitespace, and
> found 9, 10, 11, 12, 13, 32 which according to my ancient ascii chart are
> TAB, LF, VT, NP, CR, SPACE. Anyone know what NP = 12 is?
>
> Also, in trying to find the ASCII (or is it ANSI) values for characters I
> could not find the reverse function for chr() [in BASIC it is asc()]- can
> someone please tell me what reverses chr()?
>
> I had to do this yucky thing to decode whitespace ...
>
> import string
> x=string.whitespace
> for b in x:
>      for i in range(256):
>          if chr(i) == b:
>              print i
>
> Ray Tomes
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 6/25/2003






More information about the Python-list mailing list