繁体   English   中英

有什么方法可以在 Google App Script 中使用 python function 吗?

[英]Is there any way to use python function in Google App Script?

如果我有一个 python 脚本,例如:

def hello():
    return 'Hello World'

如何在 Google App Script 中调用此 python 脚本? 或者如何为返回此 python function 的电子表格创建自定义 function? 就像是:

function callPythonFunction() {
  const result = //hello function from python script
  return result; // 'Hello World' from hello()
}

如果我在电子表格中使用它:

=callPythonFunction()

我在单元格中得到“Hello World”。

我认为除了在第 3 方服务中运行 python 应用程序然后使用UrlFetch()从 GAS 调用它(我见过有人这样做但没有完全尝试过)或在python如果您想访问电子表格,请使用gspread

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM