简体   繁体   English

Zapier Python 编辑器没有 output 任何东西,即使代码在 python 中工作

[英]Zapier Python editor doesn't output anything even though code works in python

I'm trying to create code that matches True/False messages from checkboxes from a form to the checkbox titles.我正在尝试创建与从表单的复选框到复选框标题的真/假消息相匹配的代码。 Whenever the checkboxes are clicked, the titles should be appended to a list that is outputted in the end.每当单击复选框时,标题应附加到最后输出的列表中。

This is my code:这是我的代码:

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)

I've tried everything, but the Zapier Interpreter shows no output.我什么都试过了,但是 Zapier 解释器没有显示 output。

this is the zapier output enter image description here这是 zapier output在此处输入图像描述

Your problem is in the last line: output = print(result) .您的问题在最后一行: output = print(result)

The print function doesn't return anything (it just prints), so your output is None . print function 不返回任何内容(它只是打印),所以你的outputNone

Instead, return your result:相反,返回您的结果:

return {'result': result}

(output must be a dict , not a string) (输出必须是dict ,而不是字符串)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在 Zapier 的 python 代码中无法获得 output - I can't get an output in my python code in Zapier VS 代码:Python 程序正确调试,但在 output 中显示“无法找到 python 模块”,即使我没有导入任何东西 - VS Code: Python program debugs properly, but shows "Unable to find python module" in the output, even though I am not importing anything SMTP 没有 output python 中的任何内容 - SMTP doesn't output anything in python 树莓派上的 Python3 程序不播放声音,即使音频可以正常工作 - Python3 program on raspberry pi doesn't play sound, even though audio works otherwise 即使使用相同的解释器从 shell 运行,使用 python IntelliJ 运行也不起作用 - Run using python IntelliJ doesn't work even though run from shell using same interpreter works python代码不打印任何东西 - The python code doesn't print anything 即使curl有效,Python仍会请求407状态代码的代理 - Python requests with proxies 407 status code even though curl works Python即使存在并且位于正确的目录中也不会打开文件 - Python Doesn't Open File Even Though it Exists and Is in Correct Directory Python 即使已安装也无法识别 pandas - Python doesn't recognise pandas even though installed Zapier中未运行Python代码 - Python Code not running in Zapier
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM