import pickledef foo(): print('foo')xuxu1 = pickle.dumps(foo)#不可以报错f = open('PICKLE_test','wb')f.write(xuxu1)f.closed
import pickledef foo(): print('foo')f = open('PICKLE_test','rb')data = f.read()data = pickle.loads(data)data()