PICKLE模块

import pickle


def foo():
print('foo')

xuxu1 = pickle.dumps(foo)#不可以报错
f = open('PICKLE_test','wb')
f.write(xuxu1)
f.closed


import pickle
def foo():
print('foo')
f = open('PICKLE_test','rb')

data = f.read()
data = pickle.loads(data)

data()
posted @ 2017-12-21 16:07  无敌帅帅头  阅读(101)  评论(0编辑  收藏  举报