一直用C++的,不会脚本,有时候真的很头大,C++编译,部署太麻烦了~
import redis
import string
r = redis.Redis(host='192.168.1.110',port=6381,db=0)
keys = r.keys('R_AWARD*');
for k in keys:
# print(k) +':' + r.get(k)
v = r.get(k) ;
print(k) +': ' + v;
if (string.atoi(v) < 1):
print('delete: ' + k);
r.delete(k);
#print(keys)