Is there a Python module that already does this?

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Wed Feb 6 08:52:01 EST 2002


----- 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.






More information about the Python-list mailing list