whitespace and ?asc()?
staschuk at telusplanet.net
Wed Jul 2 05:42:49 CEST 2003
Quoth Ray Tomes:
> Also, in trying to find the ASCII (or is it ANSI) values for characters I
The only thing nobody else commented on:
The character code standard is ASCII (American Standard Code for
Information Interchange, if memory serves), but it is an ANSI
standard (the American National Standards Institute). (There's an
equivalent ISO standard, I think... ISO 646?)
In some communities, "ANSI" is used metonymously to refer to some
specific ANSI standard for terminal control codes, I think. But
this has nothing to do with ASCII.
> I had to do this yucky thing to decode whitespace ...
> import string
> for b in x:
> for i in range(256):
> if chr(i) == b:
> print i
Note also that at the interpreter prompt you can (some of) those
ASCII codes in hex just by looking at the value of the string:
>>> import string
If your ASCII chart doesn't have hex, continue with
>>> 0x0b, 0x0c
to obtain the decimal values.
Steven Taschuk staschuk at telusplanet.net
"Our analysis begins with two outrageous benchmarks."
-- "Implementation strategies for continuations", Clinger et al.
More information about the Python-list