Skip to content

Commit

Permalink
redis
Browse files Browse the repository at this point in the history
  • Loading branch information
sohwaje committed Mar 30, 2021
1 parent bff8676 commit 7a7271f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions study/redis-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import redis

myHostname = ""
myPassword = ""

r = redis.StrictRedis(host=myHostname, port=6380,
password=myPassword, ssl=True)

result = r.ping()
print("Ping returned : " + str(result))

result = r.set("Message", "Hello!, The cache is working with Python!")
print("SET Message returned : " + str(result))

result = r.get("Message")
print("GET Message returned : " + result.decode("utf-8"))

result = r.client_list()
print("CLIENT LIST returned : ")
for c in result:
print("id : " + c['id'] + ", addr : " + c['addr'])

0 comments on commit 7a7271f

Please sign in to comment.