Is there a Python module that already does this?
Karl M. Syring
syring at email.com
Wed Feb 6 10:40:18 EST 2002
More information about the Python-list mailing list
Wed Feb 6 10:40:18 EST 2002
- Previous message (by thread): Is there a Python module that already does this?
- Next message (by thread): Is there a Python module that already does this?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"MDK" <mdk at mdk.com> schrieb > "Chris Gonnerman" <chris.gonnerman at newcenturycomputers.net> wrote in message > news:mailman.1013003651.8981.python-list at python.org... > > ----- Original Message ----- > > From: "MDK" <mdk at mdk.com> > > > > > > > I need to convert a list into a list of characters. > > > > > > For example: > > > > > > ("cat",5,['dog',[3,3,1]],"zoo") > > > > That's not a "list", it's a tuple containing strings, ints, and lists; > > further, you have nested lists. Ouch. > > > > > Would become: > > > > > > ('c','a','t',5,'d','o','g',3,3,1,'z','o','o') > > > > > > Any information would be appreciated. > > > > This is doable, but there is no Python builtin I am aware of that can > > do it. Why do you need to do this? If we understand what you are trying > > to do, we may be able to steer you away from this mess. > > > > > P.S Sorry, I used the wrong symbols. I meant > ["cat",5,['dog',[3,3,1]],"zoo"]. # Does not matter: import pickle ob = ["cat",5,['dog',[3,3,1]],"zoo"] pickle.dumps(ob) Flat enough? Karl M. Syring
- Previous message (by thread): Is there a Python module that already does this?
- Next message (by thread): Is there a Python module that already does this?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list