How to convert unicode list to ascii list?

Brian Munroe bmunroe at tribador.nu
Wed Mar 19 21:42:46 EST 2003


> -----Original Message-----
> On Behalf Of Mark Kingston
> Sent: Wednesday, March 19, 2003 5:53 PM
> To: python-list at python.org
> Subject: How to convert unicode list to ascii list?
>
> I tried accessing the elements using:
>    firstElement = groups[0]
> but it returns only this:  '['
>
> How can I convert this list to a normal ASCII list so that I can access each
> element as ASCII?
>

you can use str(groups[0]) to convert it, but I tried your example via the
command interpeter that comes with ActivePython 2.2.2 and it returned 'Debugger
Users', so maybe something else is wrong with your install?

-- brian






More information about the Python-list mailing list