image - 如何使用 gspread (或任何其他包)将图像插入 Python 中的 Google 表格?
问题描述
我需要一种将图像插入特定 Google 表格中特定单元格的方法。如果有任何 python 包和/或代码片段可以实现这一点,请告诉我。据我所知,Gspread 没有任何帮助。
解决方案
总体而言,将图像添加到 Google 表格中可以使用 Python 完成,方法是首先使用 Google Drive API 将图像文件插入 Google Drive:
以下是如何将其插入谷歌驱动器。- https://developers.google.com/drive/v2/reference/files/insert#examples,
其次,使用 Google Sheets API 链接到 Google Sheets 中的图像,这里是 Google Sheets API - https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#CellData
注意:在 CellData 下查看
推荐阅读
- python - AMD Ryzen 5950X 在 MKL 2020.0 和 MKL_DEBUG_CPU_TYPE=5 下运行缓慢
- pine-script - 参考 MA 交叉前的柱线,在交叉前绘制三角形 50 根柱线
- html - 重新定位行移动
- arrays - 将“void *(struct thread_args *)”传递给“void * _Nullable (* _Nonnull)(void * _Nullable)”类型参数的不兼容指针类型
- spring - 在 SCG 中将 SCLB 与多个服务器列表一起使用
- mysql - 使用python使用mysql.connector传输数据时出现MySQL连接错误
- deep-learning - 通过数据增强创建更多数据或对现有数据应用随机转换之间有区别吗?
- postgresql - 关键字 FUNCTION 是什么意思?
- java - 等于表达式中的整数运算
- docker - AlpineOS 上的 Nginx 配置命令