Getting the code of a character ?

Sean Blakey sblakey at freei.com
Tue Sep 12 17:29:05 EDT 2000


On Sep 12 at 11:13P, Gilles Lenfant wrote:
> Yes, a real newbie question !
> How to get the code number of a character like :
> x = asc("x") in stupid Basic ?
> 
> TIA

I don't know Basic, but it sounds like you ar elooking for the built-in
ord() function:
>>>ord('x')
120
>>>map(ord, 'spam')
[115, 112, 97, 109]
>>>
    -Sean

-- 
Sean Blakey, sblakey at freei.com
Software Developer, FreeInternet.com
(253)796-6500x1025
As in certain cults it is possible to kill a process if you know its true name.
		-- Ken Thompson and Dennis M. Ritchie




More information about the Python-list mailing list