gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 09:08:59 24 4
gpt4 key购买 nike

我正在尝试将电子邮件地址作为超链接插入到 google 工作表单元格中,这样只会出现“电子邮件”一词,而不是整个电子邮件地址,这里是我想做的示例 a cell that contain a hyperlink which is actually an email address

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

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")

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

最佳答案

我发现可以使用 google 表格公式

sheet.update_acell('A14','=HYPERLINK("seyepapeseny@gmail.com","email")')

关于python - 如何使用 gspread 在 google 工作表单元格中插入任何超链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62835511/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com