gspread上的紧密连接

2024-03-28 20:06:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个python脚本,它使用gspread从googlespreedsheet获取信息。在

            scope = ['https://spreadsheets.google.com/feeds']
            creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)
            client = gspread.authorize(creds)
            sheet_programar = client.open("FILE").worksheet("SHEET")

            # Extract and print all of the values
            list_of_hashes = sheet_programar.get_all_records()

这是持续运行的脚本的一部分,但是gspread部分只在一天中的几个位置运行。在

如果我用同样的权限,我就不能用同一个权限来访问这个脚本。在

我对这个问题的理解是第一个脚本没有关闭连接,因此我无法使用相同的凭据登录。在

我找不到任何关于如何关闭的信息?在


Tags: ofhttps脚本clientjson权限googleall