I
Iyer, Prasad C
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', 'w')
p.dump(color, f)
f.close()
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.
Another question:
Is there a concept of private variables?
regards
prasad chandrasekaran
--- Cancer cures smoking
#-----Original Message-----
#From: [email protected]
#[mailto[email protected]] On
#Behalf Of (e-mail address removed)
#Sent: Tuesday, October 18, 2005 11:00 AM
#To: (e-mail address removed)
#Subject: Python-list Digest, Vol 25, Issue 322
#
#Send Python-list mailing list submissions to
# (e-mail address removed)
#
#To subscribe or unsubscribe via the World Wide Web, visit
# http://mail.python.org/mailman/listinfo/python-list
#or, via email, send a message with subject or body 'help' to
# (e-mail address removed)
#
#You can reach the person managing the list at
# (e-mail address removed)
#
#When replying, please edit your Subject line so it is more specific
#than "Re: Contents of Python-list digest..."
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
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', 'w')
p.dump(color, f)
f.close()
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.
Another question:
Is there a concept of private variables?
regards
prasad chandrasekaran
--- Cancer cures smoking
#-----Original Message-----
#From: [email protected]
#[mailto[email protected]] On
#Behalf Of (e-mail address removed)
#Sent: Tuesday, October 18, 2005 11:00 AM
#To: (e-mail address removed)
#Subject: Python-list Digest, Vol 25, Issue 322
#
#Send Python-list mailing list submissions to
# (e-mail address removed)
#
#To subscribe or unsubscribe via the World Wide Web, visit
# http://mail.python.org/mailman/listinfo/python-list
#or, via email, send a message with subject or body 'help' to
# (e-mail address removed)
#
#You can reach the person managing the list at
# (e-mail address removed)
#
#When replying, please edit your Subject line so it is more specific
#than "Re: Contents of Python-list digest..."
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.