Skip to navigation
How to serialize a huge python object quickly and save it to a redis memory DB for a limited time
14.10.15
import redis import pickle redis = redis.StrictRedis(host='localhost', port=6379, db=0) redis.set('FOO',pickle.dumps(catalog)) redis.expire('FOO',86400) #get the object back from redis foo = pickle.loads(redis.get('FOO'))
https://docs.python.org/3.4/library/pickle.html
Reply
Anonymous
Information Epoch 1732592154
Use lower case and keep it short.
Home
Notebook
Contact us