title: redis-操作
author: 杨晓东
permalink: redis-操作
date: 2021-10-02 11:27:04
categories:
- 投篮
tags:
- demo
redis-操作
"""
redis 操作
"""
import redis
r = redis.Redis(host='localhost', port=6379, decode_responses=True)
r.set('name', 'root') # 设置 name 对应的值
r.lpush('na',12,'love','heihei','xixi','haha')
print(r['name'])
print(r.get('na')) # 取出键 name 对应的值
print(type(r.get('name'))) # 查看类型
标签:name,get,na,redis,print,操作
From: https://www.cnblogs.com/demo443/p/17155213.html