Python:'json_store_client'根据请求返回'null'

2024-04-28 12:15:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图联系json_store_client,看看我的程序执行了多少次。但是,尽管我有一个正确的密钥,但我遇到以下错误:

/home/runner/.local/lib/python3.6/site-packages/json_store_client/__init__.py:99: EmptyResponseWarning: Jsonstore returned null, please make sure something is saved under this key.
  warn('Jsonstore returned null, please make sure something issaved under this key.', EmptyResponseWarning)
Traceback (most recent call last):
  File "main.py", line 5, in <module>
    runnum = client.store("runs", runs + 1)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

我更担心第一个错误,因为它与获取数据直接相关。我转到jsonstore.io并复制粘贴了给定的密钥。这还不够吗?还是有其他方法可以做到这一点

当前代码:

from json_store_client import Client
key = "168034i5o4433136733f5e6c9c70bdee1a113474602675459e3ffa9bd584a03314f"
client = Client(key)
runs = client.retrieve("runs")
runnum = client.store("runs", runs + 1)
print(runnum)

Tags: storekeypyclientjsonmake错误runs