使用 Redis 的 brpop 时会返回 bytes. 使用decode将其转换成string
>>> b"your string".decode("utf-8")
'your string'
本文介绍如何在使用Redis的brpop命令时处理返回的bytes类型数据,并通过decode方法将其转换为string,以便于进一步的数据处理和应用。
使用 Redis 的 brpop 时会返回 bytes. 使用decode将其转换成string
>>> b"your string".decode("utf-8")
'your string'
2544
3650

被折叠的 条评论
为什么被折叠?