Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
cli中python显示的redis_Redis_Python 3.6 - Fatal编程技术网

cli中python显示的redis

cli中python显示的redis,redis,python-3.6,Redis,Python 3.6,我将数据从python推送到redis中,如下所示: ts = datetime.datetime.now().timestamp() if msg.field == 2: seq = [ts, 'ask', msg.price] r.rpush(contractTuple[0], *seq) 我希望插入的数据(seq)是redis中的一个对象。但是,当我查看reds cli中的数据时,python列表中的字段位于单独的行上: 127.0.0.1:6379> lrang

我将数据从
python
推送到
redis
中,如下所示:

ts  = datetime.datetime.now().timestamp()
if msg.field == 2:
    seq = [ts, 'ask', msg.price]
    r.rpush(contractTuple[0], *seq)
我希望插入的数据(
seq
)是
redis
中的一个对象。但是,当我查看
reds cli
中的数据时,python列表中的字段位于单独的行上:

127.0.0.1:6379> lrange ES 0 -13

406) "1523994426.496158"
407) "ask"
408) "2699.5"
127.0.0.1:6379>
这是
redis cli
显示数据的方式(如果是真的,我会觉得奇怪),还是我将数据推到
redis
中的方式不正确?

请参见:

rpush(名称,*值)

Redis没有“对象”的概念。如果希望对这些值进行分组,则必须实现自己的方法将它们(反)序列化为字符串

Push values onto the tail of the list name