小编F. *_*nim的帖子

如何在谷歌表中与正则表达式匹配不区分大小写?

我正在尝试过滤我的工作表

=filter({B:B}, regexmatch({B:B}, $A$1))
Run Code Online (Sandbox Code Playgroud)

是否可以使正则表达式不区分大小写?

regex google-sheets

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

包含具有特定文本的另一个元素的元素的 XPath?

我知道如何div在以下位置找到button

//button/div[contains(text(),'Save')]
Run Code Online (Sandbox Code Playgroud)

我想知道是否可以找到任何button包含 div 且"Save"内部有文本的内容?

<button class="PinBetterSave__Button" data-test-id="PinBetterSaveButton"><div class="_w7 _0 _1 _2 _wa _36 _d _b _6">Save</div></button>
Run Code Online (Sandbox Code Playgroud)

html xml xpath

6
推荐指数
1
解决办法
1578
查看次数

如何在 Python 中使用 Google Sheets API v4 更改列宽?

我正在尝试column width使用 Google Sheets API 进行更改。我知道spreadsheetId我可以得到ss_drive.get('id'),但我不知道如何得到sheetId

ss_drive = drive_api.files().create(body=file_metadata).execute()
ssId = ss_drive.get('id')

sheets_api = build('sheets', 'v4', credentials=credentials)

requests = []
requests.append({
    "updateDimensionProperties": {
    "range": {
      "sheetId": sheetId,
      "dimension": "COLUMNS",
      "startIndex": 0,
      "endIndex": 1
    },
    "properties": {
      "pixelSize": 160
    },
    "fields": "pixelSize"
    }
})

response = sheets_api.spreadsheets().batchUpdate(
    spreadsheetId=ssId, body={'requests': requests}).execute()
Run Code Online (Sandbox Code Playgroud)

"sheetId": sheetId改为"sheetId": 0. 并且该列的宽度也发生了变化。

python google-sheets-api

6
推荐指数
1
解决办法
1669
查看次数

如何使用 ExcelJS 读取 xlsx 文件?

从文件“C:\1.xlsx”中获取单元格 A1 值的代码应该是什么样的?我尝试了许多示例,但仍然无法使其正常工作。

var Excel = require('exceljs');

var workbook = new Excel.Workbook();

workbook.xlsx.readFile("C:\1.xlsx")
    .then(function() {
        var worksheet = workbook.getWorksheet('Sheet1');
        var cell = worksheet.getCell('A1').value;
        console.log(cell);
    });
Run Code Online (Sandbox Code Playgroud)

我没有看到任何错误,但它不起作用。

javascript xls xlsx exceljs

5
推荐指数
1
解决办法
7601
查看次数

如何使用 Python 启用 Google Assistant API 的新“阅读”功能?

近日,谷歌发布了谷歌助手新的“阅读”功能。

我如何用 Python 尝试它?我在控制台中启用了 Google Assistant API并创建了服务帐户凭据。该文档不提供任何 Python 实现。

我想运行一个简单的“Hello world”示例:发送文本并获取 wav 文件。

python google-api python-3.x google-assist-api google-assistant-sdk

5
推荐指数
1
解决办法
229
查看次数

如何使用 Autohotkey 打开新的 chrome 标签页?

此代码打开一个新的 chrome 选项卡,并将整个 chrome 窗口放在所有其他正在运行的程序后面:

Browser = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
URL = "http://cyberforum.ru"

Name = Mid(Browser, InStrRev(Browser, "\") + 1)
For Each P In GetObject("winmgmts:\\.\root\CIMV2")._
ExecQuery("Select ParentProcessID from Win32_Process Where Name = '" & Name & "'")
  PID = P.ParentProcessID : If InStr(PIDs & " ", " " & PID & " ") Then Exit For
  PIDs = PIDs & " " & PID
Next

With CreateObject("WScript.Shell")
  Set Exe = .Exec(Browser & " " & URL)
  If IsEmpty(PID) Then PID …
Run Code Online (Sandbox Code Playgroud)

autohotkey

3
推荐指数
1
解决办法
3429
查看次数

如何在 Excel 或 Google Sheets 中结合 if 和 cycle?

我正在尝试计算 column 中所有字符串长度的总和,这些字符串与 columnB中的intorfloat数字位于同一行A。如何对列中的任何值组合循环执行此操作A?我完全迷失了 Excel 的 if 和 cycle 表示法。

在此处输入图片说明

excel xls xlsx google-sheets xlsxwriter

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

如何在 Python 中使用服务帐户凭据创建 Google 表格?

Service Account Credentials 我在这里创建并得到了 json key service.json

然后我尝试:

from google.oauth2 import service_account

SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
credentials = service_account.Credentials.from_service_account_file(
        'service.json', scopes=SCOPES)

drive = build('drive', 'v3', credentials=credentials)
file_metadata = {
    'name': 'sampleName',
    'parents': ['#### folderId ###'],
    'mimeType': 'application/vnd.google-apps.spreadsheet',
}
res = drive.files().create(body=file_metadata).execute()
print(res)
Run Code Online (Sandbox Code Playgroud)

有错误:

<HttpError 403 when requesting https://www.googleapis.com/drive/v3/files?alt=json returned "Insufficient Permission: Request had insufficient authentication scopes.">

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "dailyLimitExceededUnreg",
    "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
    "extendedHelp": "https://code.google.com/apis/console" …
Run Code Online (Sandbox Code Playgroud)

python google-authentication google-drive-api google-console-developer google-sheets-api

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