Easily convert unicode tuple to python string tuple???

Discussion in 'Python' started by Michal Mikolajczyk, Apr 20, 2004.

  1. 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/
    Michal Mikolajczyk, Apr 20, 2004
    #1
    1. Advertising

  2. Michal Mikolajczyk

    Larry Bates Guest

    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" <> wrote in message
    news:...
    > 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/
    >
    >
    Larry Bates, Apr 20, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Epler
    Replies:
    0
    Views:
    932
    Jeff Epler
    Apr 20, 2004
  2. Bill Scherer
    Replies:
    0
    Views:
    603
    Bill Scherer
    Apr 20, 2004
  3. Chris  Song
    Replies:
    3
    Views:
    264
    Ganesan Rajagopal
    Dec 27, 2005
  4. Jeremy
    Replies:
    1
    Views:
    793
    Alex Willmer
    Jan 11, 2011
  5. Jeremy
    Replies:
    0
    Views:
    566
    Jeremy
    Jan 11, 2011
Loading...

Share This Page