O'Reilly logo

Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython by Richard Hightower

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

pickle and the Address Book Application

Now that we have a handle on the pickle module, we can change our address book program to use it. Here's the listing for address4 (areas of interest are highlighted in bold):

 class Address: """This class represents an entry in an address book""" #Constructor def __init__(self, name="", phone_number="", address_lines=[]): """ The constructor takes three arguments: name to hold the persons' name (string) phone_number to hold the persons' phone number (string) address_lines to hold the address of the person (list) """ # assign the name, phone_number and address_lines to the # instance variables # __name, __phone_number, and __lines self.__name=name self.__phone_number=phone_number self.__lines=address_lines ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required