Re: lists and dictionaries

2007-07-17 Thread Ladislav Andel
Hi, could you actually help me further? I thought it will quite easy but I've been programming in python just for a month. I need to add extra items in new list. So here is example: I have a list of dictionaries. e.g. [{'index': 0, 'ip_addr': '1.2.3.4', 'server-name':'Asterisk', 'transport': 'ud

Re: lists and dictionaries

2007-07-12 Thread Ladislav Andel
Thank you to all of you guys. It's exactly I was looking for. Lada Bart Ogryczak wrote: > On 12 jul, 04:49, anethema <[EMAIL PROTECTED]> wrote: > >>> li = [ {'index': 0, 'transport': 'udp', 'service_domain': >>> 'dp0.example.com'}, >>> {'index': 1, 'transport': 'udp', 'service_domain

Re: lists and dictionaries

2007-07-12 Thread Ladislav Andel
Thank you to all of you guys. It's exactly I was looking for. > You provide scant information for this task. For example, is the > new list ordered or unordered? Can the list corresponding to the > 'transports' key contain duplicates? > unordered is fine.. I will be storing it in DB from that

Re: lists and dictionaries

2007-07-12 Thread Bart Ogryczak
On 12 jul, 04:49, anethema <[EMAIL PROTECTED]> wrote: > > li = [ {'index': 0, 'transport': 'udp', 'service_domain': > > 'dp0.example.com'}, > > {'index': 1, 'transport': 'udp', 'service_domain': > > 'dp1.example.com'}, > > {'index': 0, 'transport': 'tcp', 'service_domain': > > 'dp0

Re: lists and dictionaries

2007-07-12 Thread Bart Ogryczak
On 11 jul, 21:08, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hi, > I have a list of dictionaries. > e.g. > [{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'}, > {'index': 1, 'transport': 'udp', 'service_domain': 'dp1.example.com'}, > {'index': 0, 'transport': 'tcp', 'service_do

Re: lists and dictionaries

2007-07-11 Thread anethema
> li = [ {'index': 0, 'transport': 'udp', 'service_domain': > 'dp0.example.com'}, > {'index': 1, 'transport': 'udp', 'service_domain': > 'dp1.example.com'}, > {'index': 0, 'transport': 'tcp', 'service_domain': > 'dp0.example.com'}, > {'index': 1, 'transport': 'tcp', 'servi

Re: lists and dictionaries

2007-07-11 Thread [EMAIL PROTECTED]
On Jul 11, 12:08 pm, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hi, > I have a list of dictionaries. > e.g. > [{'index': 0, 'transport': 'udp', 'service_domain': 'dp0.example.com'}, > {'index': 1, 'transport': 'udp', 'service_domain': 'dp1.example.com'}, > {'index': 0, 'transport': 'tcp', 'service