Easily convert unicode tuple to python string tuple???

M

Michal Mikolajczyk

Is there a quick way to convert a unicode tuple to a tuple containing python
strings?

(u'USER', u'NODE', u'HASH', u'IDNBR')

to this:

('USER', 'NODE', 'HASH', 'IDNBR')

I need to be able to do this for a lot of tuples, not just one.

Thanks,
Michael

_________________________________________________________________
Watch LIVE baseball games on your computer with MLB.TV, included with MSN
Premium!
http://join.msn.com/?page=features/mlb&pgmarket=en-us/go/onm00200439ave/direct/01/
 
L

Larry Bates

I always just used:

myuTuple=(u'USER', u'NODE', u'HASH', u'IDNBR')

mysTuple=[str(x) for x in myuTuple]

Larry Bates
Syscon, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top