小编Sey*_*eye的帖子

如何使用 gspread 在 google 工作表单元格中插入任何内容作为超链接

我正在尝试将电子邮件地址作为超链接插入到谷歌工作表单元格中,以便仅显示单词“电子邮件”而不是整个电子邮件地址,这里是我想要执行的包含超链接的单元格的示例实际上是一个电子邮件地址

这是我尝试的最后一个代码

import hyperlink
from oauth2client.service_account import ServiceAccountCredentials
from pprint import pprint

scope = ["https://spreadsheets.google.com/feeds", 'https://www.googleapis.com/auth/spreadsheets',
         "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive"]

creds = ServiceAccountCredentials.from_json_keyfile_name("creds.json", scope)

client = gspread.authorize(creds)

sheet = client.open("influenceurs_35k-55k(08.07.20)").sheet1

data = sheet.get_all_records()

col = sheet.col_values(2)

insertRow = ["hello", 5, "red", "blue"]

sheet.delete_rows(14)

sheet.insert_row(insertRow, 14)

sheet.update_cell(14,1, "seyepapeseny@gmail.com".format("email"))

sheet.format("A14:b14")
Run Code Online (Sandbox Code Playgroud)

“seyepapeseny@gmail.com”是我想用 gspread 作为超链接插入的电子邮件

python google-sheets google-drive-api gspread google-sheets-api

2
推荐指数
1
解决办法
2854
查看次数