Wayne Ringling wrote:
> 
>  I would like to store a two dimensional dictionary in a file on disk.  But
> I can't seem to get it working.  Can anybody advice me of a sample piece of
> code to start from.  Thanks in advance.

        myDict = {(0,0): 'tomato',
                  (1,0): 'cucumber'}

        from cPickle import dump
        dump(myDict, open('mydict.pik', 'wb'))

and then later:

        from cPickle import load
        myDict = load(open('mydict.pik', 'rb'))


help("cPickle") is always helpful =)

Cheers,

--david ascher
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to