How to convert unicode list to ascii list?

Martin v. Löwis martin at v.loewis.de
Thu Mar 20 02:11:44 EST 2003


"Mark Kingston" <mkingston at shaw.ca> writes:

> How can I convert this list to a normal ASCII list so that I can access each
> element as ASCII?

You can convert an individual Unicode object u to an ASCII string by writing

u.encode("ascii")

HTH,
Martin




More information about the Python-list mailing list