2024-06-02 20:57:23 发布
网友
我正在尝试使用OpenWhisk运行此函数:
def main(): return {"payload": "Hello world"}
包括以下内容:
在本地运行函数时,将返回一个字典,但运行上述命令会出现以下错误:
"result": { "error": "The action did not return a dictionary." }
我错过了什么?在
将代码更改为:
def main(args): return {"payload": "Hello world"}
The Python actions consume and produce a dictionary。因此,您需要“args”。在
main()输入不能为空接受dict-like main(args)
将代码更改为:
The Python actions consume and produce a dictionary。因此,您需要“args”。在
main()输入不能为空接受dict-like main(args)
相关问题 更多 >
编程相关推荐