[Tutor] converting unicode

Max Noel maxnoel_fr at yahoo.fr
Wed Dec 1 04:00:18 CET 2004


On Dec 1, 2004, at 02:36, Rene Bourgoin wrote:

>
> Wandering how i could convert an entire tuple of unicode strings to 
> python strings using str(u'string')
>
> stringtuple = ()
> stringtuple = (u'string1',u'string2',u'string3')
>
> str(u stringtuple) # syntax problem here!!!

	That's another job for my friends the list comprehensions!

out = tuple([str(element) for element in stringtuple])

-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting 
and sweating as you run through my corridors... How can you challenge a 
perfect, immortal machine?"



More information about the Tutor mailing list