[Zope] removing an item from a list

Eric Walstad eric@walstads.net
Tue, 19 Jun 2001 09:55:52 -0700


Sven,
If it's a comma delimited string, you could use:
string.split(bozo, ',')
to turn it into a list.  If you can turn bozo into a list first, things will
work the way you want them to.
Otherwise, you'll need to use slice operations on the string to remove the
elements.
Eric.

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Junk
> Sent: Tuesday, June 19, 2001 9:00 AM
> To: Phil Harris; zope@zope.org
> Subject: RE: [Zope] removing an item from a list
>
>
> ---
> If the thing in question is really a list not a string as you
> show here then
> couldn't you do something like:
> bozo.del[2]
> which should delete the third item in the list.
> ---
>
> problem is i don't know where the string is, i only know it's contents...
>
> and it "seems" to behave like a list because i can use
> _.whrandom.choive(bozo) succesfully on it.
>
> i'm still in the dark ;-)
>
> $ven
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )