import redis

r = redis.Redis(host=xxx.xxx.xxx.xxx, port=xxx,password=xxx, db=0)

# ......  
#sadd:是针对redis中set类型数据进行插入
#如果你的redis数据是list类型那么使用lpush 或者 rpush
with r.pipeline(transaction=False) as p:
       for value in values:
           p.sadd(key, value)
       p.lpush(key,value)
       p.execute()

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2021-06-28
猜你喜欢
  • 2021-11-27
  • 2021-11-28
  • 2021-11-26
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案