problems getting a single item out of a list

Andres Meza andres.meza at
Wed Sep 18 12:01:09 EDT 2002

Manuel Hendel wrote:
> I try to get a single item out of a list, but after this, the single
> item is stil a list item.
> domainfield = fields[3:4]
> I just want to get a new variable with a the value of the 3rd item of
> the list fields.

If I understand your question, you have two ways to make it work, from
my point of view:
a) Get the value from domainfield:

    domainfields = fields[3:4]
    value = domainfields[0]

b) Get the value directly from the list:

    value = fields[3]

I hope it helps.

   Andrés Meza
   Technical Manager
 __Nuevos Medios - NM S.A.____________________
   e-mail:         andres.meza at
   day time phone: (+572)6827794 ext.102
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list