Strings show as brackets with a 'u'.

Terry Reedy tjreedy at udel.edu
Wed Jul 27 05:04:58 CEST 2011


On 7/26/2011 9:18 PM, goldtech wrote:
> Thank you. So what is happening? Is it that I'm in an environment that
> is not unicode and python is telling me the string (ie. n[0]) is
> unicode?

Yes, n is a list and n[0] is a unicode string and you are using some 
2.x, which is ascii/byte string based. Python 3 is unicode based.

If you do not *need* to use 2.x and are just learning Python, I 
personally recommend starting with Python 3. Others agree with me, still 
other do not. I would add 'especially if you want to use unicode'.

Rick gave you some good advice, perhaps worth re-reading. What you need 
are investigative skills, and not just bits of data.

-- 
Terry Jan Reedy




More information about the Python-list mailing list