Feature Requests item #1441072, was opened at 2006-03-01 11:49
Message generated for change (Settings changed) made by tjreedy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1441072&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: Documentation
>Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Kent Johnson (kjohnson)
Assigned to: Nobody/Anonymous (nobody)
Summary: No simple example for pickle

Initial Comment:
The docs for pickle lack a simple example of typical
usage. The Example page has only an advanced example. I
suggest something like this be added to the Usage or
Examples page:

Here is a simple example that shows how to use pickle
to save and restore a dictionary:
 >>> import pickle
 >>> data = dict(a=1, b=2, c=[3,4,5], d='cheese')
 >>> f=open('data.pickle', 'wb')
 >>> pickle.dump(data, f)
 >>> f.close()
 >>>
 >>> f=open('data.pickle', 'rb')
 >>> data2=pickle.load(f)
 >>> f.close()
 >>> data2
{'a': 1, 'c': [3, 4, 5], 'b': 2, 'd': 'cheese'}


Kent

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1441072&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to