On Sat, Sep 10, 2011 at 17:34, Alan Gauld <alan.ga...@btinternet.com> wrote:
> On 11/09/11 00:18, Richard D. Moores wrote:
>
>>> So you open the file and from that point on treat it exactly like a
>>> dictionary.
>>
>> I'm still a bit shaky about dictionaries.
>
> But you started the post with using a dictionary.
>
> Shelve is just a dictionary that lives in a file instead of memory.
> If you can put data into or read it out of a dictionary then you can do the
> same with shelve.
>
> The only complexity is you have to open the file before sing it and close it
> when your done.
>
>> Much of what comes after that is beyond me.
>
>
>> Thanks for your encouragement Alan, but I'm still looking among my
>> Python books for a good exposition of shelve.
>
> You probably won't find much in books because shelve has such a specific
> purpose. As a result there isn't much to say about it
> if you've already covered dictionaries.
>
> It's a file based dictionary. So read up on dictionaries.
> Then just use it.
>
> There are a few limitations with shelve but for most normal
> cases you can ignore that and just use it like any normal
> dictionary.

OK, Alan, I really will give shelve a try.

Dick
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to