By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,538 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,538 IT Pros & Developers. It's quick & easy.

Easily convert unicode tuple to python string tuple???

P: n/a
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/m...ave/direct/01/
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I always just used:

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

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

Larry Bates
Syscon, Inc.

"Michal Mikolajczyk" <mi******@hotmail.com> wrote in message
news:ma**************************************@pyth on.org...
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/m...ave/direct/01/

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.