python redis 存string 取 string

DB_REDIS = {
    'host': localhost,
    'port': 6379,
    'password': 'pwd&&1',
    'db': 1,
    'decode_responses': True
}

python3使用時,給客戶端配置'decode_responses': True

就能保證存取的都是string,而不是想存string,結果卻是bytes!!!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章