即使代码在 python 中工作,Zapier Python 编辑器也不输出任何内容

Posted

技术标签:

【中文标题】即使代码在 python 中工作,Zapier Python 编辑器也不输出任何内容【英文标题】:Zapier Python editor doesn't output anything even though code works in python 【发布时间】:2021-12-31 03:38:12 【问题描述】:

我正在尝试创建将 True/False 消息从表单中的复选框匹配到复选框标题的代码。每当单击复选框时,标题应附加到最后输出的列表中。

这是我的代码:

def nische(input_data):
    nischen = []
    for key in input_data:
        if input_data[key] == True:
            print(key)
            nischen.append(key)
        if input_data['Sonstiges'] != "":
            nischen.append(input_data['Sonstiges'])
    string = ', '.join(nischen)
    string = str(string)
    return string

result = nische(input_data)
output = print(result)

​我已经尝试了所有方法,但 Zapier 解释器没有显示输出。

this is the zapier output enter image description here ​​​ ​

​ ​

【问题讨论】:

【参考方案1】:

您的问题在最后一行:output = print(result)

print 函数不返回任何内容(它只是打印),因此您的 outputNone

相反,返回您的结果:

return 'result': result

(输出必须是dict,而不是字符串)

【讨论】:

以上是关于即使代码在 python 中工作,Zapier Python 编辑器也不输出任何内容的主要内容,如果未能解决你的问题,请参考以下文章

即使在引导程序中安装 pip 后,导入也无法在 Amazon EMR 中工作

即使它们在 Eclipse pydev 中工作,我的导入也用红色下划线

Zapier 应用程序:使用 GET 请求发送正文

Q ZAPIER 卷曲请求

python串口代码在windows中工作,但在linux中不工作

即使使用了 e.preventdefault(),在显示警报窗口后退格在 Firefox 中工作