首页 > 解决方案 > 如何使用 gspread (或任何其他包)将图像插入 Python 中的 Google 表格?

问题描述

我需要一种将图像插入特定 Google 表格中特定单元格的方法。如果有任何 python 包和/或代码片段可以实现这一点,请告诉我。据我所知,Gspread 没有任何帮助。

标签: imagegoogle-sheetsgspread

解决方案


总体而言,将图像添加到 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 下查看


推荐阅读