python操作redis-为元素排序

#!/usr/bin/python
#!coding:utf-8 import time
import redis if __name__ == "__main__":
try:
conn=redis.StrictRedis(host='192.168.80.41')
conn.sadd('s001','')
conn.sadd('s001','')
conn.sadd('s001','')
print(conn.smembers('s001'))#打开 002,001,003
print(conn.sort('s001'))#打印 001,002,003
pass
except Exception as err:
print(err)
上一篇:(转)js函数前加分号和感叹号是什么意思?有什么用?


下一篇:[权限管理系统(四)]-spring boot +spring security短信认证+redis整合