I have a list that is taken from id3. tags from an .mp3. When i print the list, its a mixture of strings and tuples with unicode.
I get the following from a straight print out of the list.
[('album', [u'Singles']), ('artist', [u'Led Zeppelin']), ('title', [u'Kashmir'])]
I want to have this:
album Singles, artist Led Zeppelin, title Kashmir
I have tried to use the following:
nvar = filter(lambda x: x!="[u'" and x!="(" and x!=")" and x!="]", var)
which prints:
[('album', [u'Singles']), ('artist', [u'Led Zeppelin']), ('title', [u'Kashmir'])]
I can use:
>>> nvar = filter(lambda x: x!="[" and x!="'" and x!="(" and x!=")" and x!="]", str(var))
>>> nvar
'album, uSingles, artist, uLed Zeppelin, title, uKashmir'
but I am left with the u from unicode. If I use x!="u", then any word with a u in it will wrong after that function runs.
Also this seems to be the hard way to do things.
Any ideas? Thanks in advance.