I'm trying to retrieve some data stored in a mysql table and the output has some additional commas which I don't need.
>>> cursor.execute("SELECT REMOTE_INT FROM R3")
2L
>>> x = cursor.fetchall()
>>> x
((u'xe-0/0/0',), (u'xe-0/0/1',))
>>> x[0]
(u'xe-0/0/0',)
>>> x[1]
(u'xe-0/0/1',)
>>>
Also any suggestions on removing the 'u'? I want to be able to use these values of x in other parts of the script.
uindicates the data is a unicode string; it won't stop you from using the data anywhere else in the code.