Aaron Christensen wrote:
> Thanks for the response! Several things you stated definitely got me
> thinking. I really appreciate the response. I used what you said and I
> am able to accomplish what I needed.
Perhaps it becomes clearer when you write two helper functions
def read_record(key):
Hello,
I am trying to figure out how to populate a shelve file with a nested
dictionary.
These are my requirements:
-Create shelve file called people.db
-Append the shelve file with new people (person_1, person_2, etc.).
-Use a for loop to iterate through 'attributes' so that I do not need to
Hello,
I am trying to figure out how to populate a shelve file with a nested
dictionary.
These are my requirements:
-Create shelve file called people.db
-Append the shelve file with new people (person_1, person_2, etc.).
-Use a for loop to iterate through 'attributes' so that I do not need to
Aaron Christensen wrote:
> Hello,
>
> I am trying to figure out how to populate a shelve file with a nested
> dictionary.
>
> These are my requirements:
>
> -Create shelve file called people.db
> -Append the shelve file with new people (person_1, person_2, etc.).
> -Use a for loop to iterate
Hi Peter,
Thanks for the response! Several things you stated definitely got me
thinking. I really appreciate the response. I used what you said and I am
able to accomplish what I needed.
Thanks!
Aaron
On Mon, Dec 21, 2015 at 7:23 PM, Peter Otten <__pete...@web.de> wrote:
> Aaron
I have some code here:
groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'}
I want to add another key: 'ITALIAN' : 'orange'
How do I append this to 'groups'?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'}
I want to add another key: 'ITALIAN' : 'orange'
How do I append this to 'groups'?
groups['ITALIAN'] = 'orange'
as described at
http://docs.python.org/tut/node7.html#SECTION00750
-tkc
--
Harlin Seritt enlightened us with:
I have some code here:
groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'}
I want to add another key: 'ITALIAN' : 'orange'
How do I append this to 'groups'?
groups['ITALIAN'] = 'orange'
Sybren
--
The problem with the world is stupidity. Not saying there
Harlin Seritt [EMAIL PROTECTED] writes:
groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'}
I want to add another key: 'ITALIAN' : 'orange'
How do I append this to 'groups'?
Dictionary items have no implicit sequence, so you don't append to
one.
Assigning any value to a key in the