Is there a Python module that already does this?

MDK mdk at mdk.com
Wed Feb 6 09:21:41 EST 2002


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

This is for a project where Python is embeded in a piece of hardware and in
order to move the data around it must be "flattened".  After I get the list
of characters I am going to convert it to ASCII.





More information about the Python-list mailing list