Feature Requests item #1441072, was opened at 2006-03-01 16:49
Message generated for change (Comment added) made by gbrandl
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: Closed
>Resolution: Fixed
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
----------------------------------------------------------------------
>Comment By: Georg Brandl (gbrandl)
Date: 2006-07-28 18:10
Message:
Logged In: YES
user_id=849994
A simple example was added by Andrew in rev. 50903.
----------------------------------------------------------------------
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