Iyer, Prasad C wrote:
> How do I serialize the object color without serializing the x and
> somechar variables?
> Is there any modifier which prevents the variable from being serialized.
>
See the pickle documentation. The example given in the documentation
pickles a class while excluding one of
#Sent: Tuesday, October 18, 2005 1:01 PM
#To: Iyer, Prasad C
#Cc: python-list@python.org
#Subject: Re: Don't want to serialize a variable of object
#
#Iyer, Prasad C wrote:
#
#>Hi,
#>I got a class which I need to serialize, except for couple of variable.
#>i.e.
#>
#>import c
Iyer, Prasad C wrote:
>Hi,
>I got a class which I need to serialize, except for couple of variable.
>i.e.
>
>import cPickle as p
>class Color:
>def __init__(self):
>print "hello world"
>self.x=10
>self.somechar="this are the characters"
>color=Color()
>f=file('poem.txt'