Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Properties, dialogs, and Visu... > Object serializing with BinaryFormat...

6.3. Object serializing with BinaryFormatter

One way you can avoid distributing the icons in their original form is to convert them to a convenient binary format. Object persistence, sometimes called serialization, is a common programming need. Serializing takes an object and converts it into binary (or possibly text) data for storing in a file or database. This representation can be turned back into an object again later.

Python persistence with pickle

Python provides standard-library support for object persistence in the form of the pickle and cPickle modules. Both modules have the same interface.

Under cPython, cPickle is a C extension that’s faster than pickle (a pure Python module). cPickle has been implemented for IronPython as a built-in module.

As of IronPython 2, pickle and cPickle know how to serialize and deserialize .NET objects that support serialization.



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial