This commit is contained in:
aozhiwei 2020-11-04 14:06:38 +08:00
parent 25f1a54ca4
commit 0d34261a90

View File

@ -12,11 +12,12 @@ import pprint
argv = sys.argv
host = argv[1]
port = argv[2]
script_name = argv[3]
passwd = argv[3]
script_name = argv[4]
def writeToRedis(conn, cmdline):
assert len(cmdline) > 1
# print(cmdline)
print(cmdline)
if cmdline[0] == 'hset':
conn.hset(cmdline[1], cmdline[2], cmdline[3])
elif cmdline[0] == 'zadd':
@ -35,6 +36,7 @@ def writeToRedis(conn, cmdline):
conn = redis.Redis(host = host,
port = port,
password = passwd,
db = 0,
decode_responses = True
)