self=pickle.load(file)? (Object loads itself)

Anton81 forum at anton.e4ward.com
Sat Aug 12 12:36:32 EDT 2006


Hi!

it seems that

class Obj:
        def __init__(self):
                f=file("obj.dat")
                self=pickle.load(f)
...

doesn't work. Can an object load itself with pickle from a file somehow?
What's an easy solution?

Anton



More information about the Python-list mailing list