the asscii code of a character in a string.

Martin von Loewis loewis at informatik.hu-berlin.de
Mon May 29 11:55:41 EDT 2000


"Sameh chafik pro" <chafik at nevrax.com> writes:

> How can i catch the code ascii of a character in a string.
> the idea is :
> like the C/C++ when i want to have the code of a character in a string i can
> write:
> 
>     const char *string = "some thing";
>     char a = string[0];
> 
> i want to do the same thing in python.

Use ord("some thing"[0]).

Regards,
Martin



More information about the Python-list mailing list