[Tutor] Saving Data (fwd)

Stanfield, Vicki {D167~Indianapolis} vicki.stanfield at ROCHE.COM
Wed Dec 31 14:14:16 EST 2003


Okay, the description of format 2 is a little lean on that site. It
doesn't say that it is binary although had I understood pickling better,
I'd have gotten it.

-----Original Message-----
From: tutor-bounces at python.org [mailto:tutor-bounces at python.org] On
Behalf Of Lloyd Kvam
Sent: Wednesday, December 31, 2003 2:05 PM
Cc: Tutor
Subject: Re: [Tutor] Saving Data (fwd)


http://www.python.org/doc/lib/node63.html
3.14.2 Data stream format

This specifies:
	0 ascii data
	1 binary data (but new style classes use a log of bytes)
	2 binary data (stores new style classes efficiently)

protocol replaces the old bin parameter which was true/false for binary.

protocol 2 is new in Python2.3 (I can't test that easily, but believe it
is true.)

Danny Yoo wrote:

> 
> ---------- Forwarded message ----------
> Date: Wed, 31 Dec 2003 10:58:48 -0500 (EST)
> From: Vicki Stanfield <vicki at thepenguin.org>
> To: Danny Yoo <dyoo at hkn.eecs.berkeley.edu>
> Subject: Re: [Tutor] Saving Data
> 
> 
>>You may also find the 'shelve' module useful:
>>
>>    http://www.python.org/doc/lib/module-shelve.html
>>
>>Shelves act like dictionaries --- except that when we put things into 
>>them, they actually store on disk!  So they should allow you to save 
>>the state of your program so that you can restore it later.
> 
> 
> Do I need to change the protocol passed depending on whether I am 
> working on a Windows machine or a Linux box? It appears not. Is there 
> more information on this protocol variable? I have only found that it 
> may be None, 1, 2, or 3 and that only None and 1 work. There seems to 
> be a shortage of information on this option (in pickle or shelve 
> descriptions).
> 
> --vicki
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org 
> http://mail.python.org/mailman/listinfo/tutor
> 

-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:	603-653-8139
fax:	801-459-9582


_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list