【发布时间】:2022-10-02 04:17:22
【问题描述】:
我正在练习 python 区块链开发,当我以 json 格式添加此显示区块链时,我在response=[\'chain\': blockchain.chain,] 处收到语法错误
# Display blockchain in json format
@app.route(\'/get_chain\', methods=[\'GET\'])
def display_chain():
response= [\'chain\': blockchain.chain,
\'length\': len(blockchain.chain)]
return json(response), 200
-
始终将有问题的完整错误消息(从单词 \"Traceback\" 开始)(不在 cmets 中)作为文本(不是屏幕截图,不链接到外部门户)。完整的错误/回溯中还有其他有用的信息。
标签: python