本文介绍了python xlsxwriter 从单元格中提取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以提取我写入 xlsxwriter.worksheet 的数据?

Is it possible to extract data that I've written to a xlsxwriter.worksheet?

import xlsxwriter

output = "test.xlsx"
workbook = xlsxwriter.Workbook(output)
worksheet = workbook.add_worksheet()


worksheet.write(0, 0, 'top left')
if conditional:
    worksheet.write(1, 1, 'bottom right')

for row in range(2):
  for col in range(2):
    # Now how can I check if a value was written at this coordinate?
    # something like worksheet.get_value_at_row_col(row, col)

workbook.close()

推荐答案

没有.XlsxWriter 是只写的.如果您需要跟踪数据,则需要在 XlsxWriter 之外的自己的代码中进行.

No. XlsxWriter is write only. If you need to keep track of your data you will need to do it in your own code, outside of XlsxWriter.

这篇关于python xlsxwriter 从单元格中提取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-19 08:02