custom-function

Refresh data retrieved by a custom function in Google Sheet

我的梦境 提交于 2019-11-26 01:07:25
问题 I\'ve written a custom Google Apps Script that will receive an id and fetch information from a web service (a price). I use this script in a spreadsheet, and it works just fine. My problem is that these prices change, and my spreadsheet doesn\'t get updated. How can I force it to re-run the script and update the cells (without manually going over each cell)? 回答1: Ok, it seems like my problem was that google behaves in a weird way - it doesn't re-run the script as long as the script parameters

Syntax behind sorted(key=lambda: …)

时间秒杀一切 提交于 2019-11-25 20:19:29
I don't quite understand the syntax behind the sorted() argument: key=lambda variable: variable[0] Isn't lambda arbitrary? Why is variable stated twice in what looks like a dict ? Evan key is a function that will be called to transform the collection's items before they are compared. The parameter passed to key must be something that is callable. The use of lambda creates an anonymous function (which is callable). In the case of sorted the callable only takes one parameters. Python's lambda is pretty simple. It can only do and return one thing really. The syntax of lambda is the word lambda