MENU

关于Python-redis keys()返回字节串列表而不是字符串列表的解决办法

January 16, 2021 • 数据库技术

解决方法:

  • 在使用StrictRedis链接数据库时添加参数decode_responses=True,代码如下:

    StrictRedis(host='localhost',port=6379,db=0,password=None,decode_responses=True)