使用 google 云函数生成 python 脚本

Using google cloud function to spawn a python script

我需要执行一些 python 机器学习代码,并希望从 Google 云函数中的节点进程执行它。

我想使用节点,因为我有一些 firebase 管理任务我想在之后 运行。我也有一个我满意的带有节点的部署工作流程。

这可能吗?如果是这样,你能给我举个例子吗?

是的,这是可能的,您可能需要使用 http://www.pyinstaller.org/ to package the python code. Have a look at my python library for actually writing your functions in python to do it, or just copy paste whatever parts you need to do it yourself: https://github.com/MartinSahlen/cloud-functions-python/