Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are those little "u" in my tuple? (python 2.7) [duplicate]

So i'm getting data from something sqlExtractor, I can't touch to sqlExtractor. problem is sqlExtractor is giving me a list of tuple (I'd like a list of list)

So I thought about that :

myNewList = []
for tuple in myList:
    myNewList.append(list(tuple))

problem is, my data are filled with little "u", what do they mean? They don't really bother me but since myNewList[i][j] will return the value without the "u". But I'd like to understand.

So, what are they?

Thanks.

example - a tuple before and after conversion :

(u'Pado', u'Seba*', u'B31', u'27/02/2011', u'SINA', u'2', u'5', u'Paris', u'Zone bleu', u'211')
[u'Pado', u'Seba*', u'B31', u'27/02/2011', u'SINA', u'2', u'5', u'Paris', u'Zone bleu', u'211']
like image 230
sliders_alpha Avatar asked Dec 26 '22 07:12

sliders_alpha


1 Answers

The u indicates that the string is a unicode object. See here for details

like image 125
That1Guy Avatar answered Dec 30 '22 15:12

That1Guy