This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kjohnson
Recipients
Date 2006-03-01.16:49:38
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
History
Date User Action Args
2007-08-23 16:11:43adminlinkissue1441072 messages
2007-08-23 16:11:43admincreate