¡Esta es una revisión vieja del documento!
$ wget <desired redis version> $ tar xzf <file> $ cd <created folder> $ make
$ redis-server
$ redis-cli
ping, if everything is good, the server will respond pong.select, to select one of the 16 databases that Redis manage.$ pip install redis
import redis r = redis.StrictRedis(host='192.168.0.100', db=0, socket_timeout=2) r.set('foo', 'bar') print r.get('foo')
db argument.flushdb() will flush the database you are connected to (cleaning all the keys), while flushall() will clear all the keys in every database.ConnectionPool class).import redis POOL = redis.ConnectionPool(host='10.0.0.1', port=6379, db=0) def getVariable(variable_name): my_server = redis.Redis(connection_pool=POOL) response = my_server.get(variable_name) return response def setVariable(variable_name, variable_value): my_server = redis.Redis(connection_pool=POOL) my_server.set(variable_name, variable_value)