whitespace and ?asc()?

Mike C. Fletcher mcfletch at rogers.com
Tue Jul 1 22:42:24 EDT 2003


Ray Tomes wrote:

> 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. 

Yay!

> 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? 

FormFeed (FF) if my memory serves.  Doing:
    print '\x0c' # hexidecimal 12
also prints an FF in PythonWin, so seems likely that's it.

> 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()? 

ord(character) in Python.  Note that unichr() is also reversed by ord, 
very tricky function that ord :) .

> I had to do this yucky thing to decode whitespace ... 

Ick, off to the dungeons with you! ;)

HTH,
Mike

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/








More information about the Python-list mailing list