python3.6 uses pickle to serialize class

  • 2020-12-26 05:49:26
  • OfStack

As shown below:


from library.connecter.database.mongo import Op_Mongo
a = pickle.dumps(Op_Mongo)
# serialization 
b = pickle.loads(a)
# deserialization 

Related articles: