how to use 'pickle'

后端 未结 3 1063
谎友^
谎友^ 2020-12-21 16:50

my code(i was unable to use \'pickle\'):

class A(object):
    def __getstate__(self):
        print \'www\'
        return \'sss\'
    def __setstate__(self,         


        
3条回答
  •  囚心锁ツ
    2020-12-21 17:39

    In a nutshell, in your example, e equals a.

    Don't have to care about these strang strings, you can dumps these strings to save to anywhere, just remember when you loads them, you got 'a' object again.

提交回复
热议问题