[英]Is it possible to run a python script from google sheets on a button press?
I have a script that reads from a google sheet and uses the information to create tickets using the Jira python api. 我有一个脚本,该脚本从Google工作表中读取并使用该信息通过Jira python API创建票证。 In my situation it won't work to have the script be triggered at a certain time, the script has to be triggered through the sheet.
在我的情况下,在特定时间触发脚本是行不通的,必须通过工作表触发脚本。 Is there some way to detect a button press or a cell change which runs my local python file?
有什么方法可以检测运行我的本地python文件的按钮按下或单元格更改吗?
I had a similar problem. 我有一个类似的问题。 there is a tool set call 'gspread', which can read from python data from your Google sheets.
有一个名为“ gspread”的工具集,可以从您的Google表格中读取python数据。 What I did is a script in the spread sheet, what filled a cell with "Start + time".
我所做的是电子表格中的脚本,该脚本用“开始+时间”填充了一个单元格。 You can trigger script with this with a button.
您可以通过按钮触发脚本。
Now the python program read this cell every minute. 现在,python程序每分钟读取一次此单元格。 If the cell contains the start trigger, if fires the python script.
如果单元格包含启动触发器,则触发python脚本。
Not the nicest solution, but it works for a few years now. 这不是最好的解决方案,但是它已经运行了几年。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.