Getting the code of a character ?

Sean Blakey sblakey at
Tue Sep 12 23:29:05 CEST 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 ?

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

Sean Blakey, sblakey at
Software Developer,
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