On 8/1/2011 8:34 PM, Mike Nickey wrote:
[snip]
[{'city': 'Buena Park', 'region_name': 'CA', 'area_code': 714},
{'city': 'Wallingford', 'region_name': 'CT', 'area_code': 203},
{'city': 'Schenectady', 'region_name': 'NY', 'area_code': 518},
{'city': 'Athens', 'region_name': '35'}]
IMHO this is
to a variable
>
> Or you can append to a list directly.
>
> l = []
>
> for d in yourdict:
> l.append(d['city'])
>
>
> Sent from my Verizon Wireless BlackBerry
>
> -Original Message-
> From: Mike Nickey
> Sender: tutor-bounces+eire1130=gmail.
irectly.
l = []
for d in yourdict:
l.append(d['city'])
Sent from my Verizon Wireless BlackBerry
-Original Message-
From: Mike Nickey
Sender: tutor-bounces+eire1130=gmail@python.org
Date: Mon, 1 Aug 2011 15:26:32
To: ian douglas
Cc:
Subject: Re: [Tutor] Accessing Speci
Mike Nickey wrote:
The input being used is through pygeoip.
Using this I am pulling the data by IP and from what I am reading this
populates as a dictionary.
Here is some of the output that I can show currently
[{'city': 'Buena Park', 'region_name': 'CA', 'area_code': 714},
{'city': 'Wallingford
The input being used is through pygeoip.
Using this I am pulling the data by IP and from what I am reading this
populates as a dictionary.
Here is some of the output that I can show currently
[{'city': 'Buena Park', 'region_name': 'CA', 'area_code': 714},
{'city': 'Wallingford', 'region_name': 'CT
On 08/01/2011 03:05 PM, Mike Nickey wrote:
Hi all,
I'm trying to access and use specific items within a dictionary that
is returned but am having issues in doing so.
[{'city': 'Sunnyvale', 'region_name': 'CA', 'area_code': 408,
'metro_code': 'Santa Clara, CA', 'country_name': 'United States'}]
ct: [Tutor] Accessing Specific Dictionary items
Hi all,
I'm trying to access and use specific items within a dictionary that
is returned but am having issues in doing so.
[{'city': 'Sunnyvale', 'region_name': 'CA', 'area_code': 408,
'metro_
Hi all,
I'm trying to access and use specific items within a dictionary that
is returned but am having issues in doing so.
[{'city': 'Sunnyvale', 'region_name': 'CA', 'area_code': 408,
'metro_code': 'Santa Clara, CA', 'country_name': 'United States'}]
How can I populate a list of many different r