What is this 'u' in my list

Erik Max Francis max at alcyone.com
Mon Mar 10 15:33:07 EST 2003


Antun Karlovac wrote:

> I just created a list and when I printed it out to the console, I
> got:-
> 
> [u'name', u'size', u'expression', u'number', u'reference', u'string',
> u'color']
> 
> What is the u before the string?

It means it's Unicode.  Use the .encode method of the Unicode objects to
convert them to some other encoding.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ There I was / There I was / Splitting atoms with my desire
\__/ Lamya
    CSBuddy / http://www.alcyone.com/pyos/csbuddy/
 A Counter-Strike server log file monitor in Python.




More information about the Python-list mailing list