Easily convert unicode tuple to python string tuple???

Larry Bates lbates at swamisoft.com
Tue Apr 20 16:37:59 EDT 2004


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" <michal65 at hotmail.com> wrote in message
news:mailman.802.1082474513.20120.python-list at python.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/mlb&pgmarket=en-us/go/onm00200439ave/direct/01/
>
>





More information about the Python-list mailing list