1 from redis import StrictRedis 2 def demo(): 3 sr = StrictRedis(host='192.168.2.180') 4 try: 5 result = sr.set('name','itheima') 6 print(result) 7 except Exception as e: 8 print(e) 9 if __name__ == '__main__':10 demo()
本文共 311 字,大约阅读时间需要 1 分钟。
1 from redis import StrictRedis 2 def demo(): 3 sr = StrictRedis(host='192.168.2.180') 4 try: 5 result = sr.set('name','itheima') 6 print(result) 7 except Exception as e: 8 print(e) 9 if __name__ == '__main__':10 demo()
转载于:https://www.cnblogs.com/mia0812/p/11020756.html