Drayton
Drayton

Reputation: 23

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

If I have a python script, for example:

def hello():
    return 'Hello World'

How can I call this python script in Google App Script? Or how can I create a custom function for spreadsheet which return this python function? Something like:

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

And if I use this in spreadsheet:

=callPythonFunction()

I get 'Hello World' in the cell.

Upvotes: 0

Views: 87

Answers (1)

NightEye
NightEye

Reputation: 11214

I think there is no another way other than running the python app in a 3rd party service and then call it from GAS using UrlFetch() (I've seen someone do this but not tried it entirely), or using Google's API in python or gspread if you want to have access onto spreadsheets.

Upvotes: 1

Related Questions