【问题标题】:Can I control the output of insert_row in GSpread?我可以在 GSpread 中控制 insert_row 的输出吗?
【发布时间】:2015-06-22 20:27:44
【问题描述】:

我已经使用 Gspread(https://github.com/burnash/gspread) 成功地将一些数据导入 Gsheets。但是,我看到 insert_row 正在获取值和单元格详细信息。我可以控制它吗,我只想导入“值”而不是单元格详细信息?

worksheet.insert_row(cell_list, row) 

<Cell R1C1 u'this is the value'>, <Cell R1C2 u'this is the value'>, <Cell R1C3 u"this is the value'>

我查看了一些关于 SO 的 gspread 相关帖子,没有类似的。这篇文章给了我一些见解gspread or such: help me get cell coordinates (not value)

update_cells(list) 工作得非常好(在给定范围内更新),但我无法插入新行或新列。现在,我正在使用这种方法 (update_cells()),它只为我获取值。谢谢!!

【问题讨论】:

    标签: python-2.7 google-sheets gspread


    【解决方案1】:

    这行得通!

    objects = Someapi.issues()    
    values = []
    for issue in objects: #you can change the range here
        values.append(issue.name)
    print values #Ignore this statement, Just see what values are printed!!
    worksheet.insert_row(values)
    

    有人帮助了我。谢谢!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-19
      • 2012-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-19
      相关资源
      最近更新 更多