Python:将变量输出到现有的 Excel 工作表

标签 python excel xlrd

我想知道如何使用 Python 变量输出到现有的 Excel 工作表。

给定excel列

[A] [B] [C] [D] [E] [F] [G] [H] [I] [J]

注意:

  • 列表项 [A] [B] [C] [D] : 在一个 excel 文件 (text.xlsx) 中给出
  • 我已将 [E] [F] 、 [H] [I] 上的字符串(基于 [A][B][C][D] 的操作)准备好作为变量
  • 我在 [G] [J](基于 [A][B][C][D] 的操作)上有一个 int (%) 准备好作为变量

对于 excel 输入,我使用的是 xlrd,但我想知道如何将这些变量输出到相同/现有的 excel 文件中?我使用哪个库?

最佳答案

有一些 python 包可用于处理 Excel 文件,这些文件将在任何 Python 平台上运行,并且不需要使用 Windows 或 Excel。它们快速、可靠且开源,如 openpyxl , xlsxwriter .

还有 this可能会帮助您更新现有的 excel 文件。

关于Python:将变量输出到现有的 Excel 工作表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56751518/

相关文章:

python - 不使用 SET 的两个字符串列表之间的区别

python - UnicodeEncodeError,需要修复

excel - 当文档另存为 PDF 时,VBA 超链接不起作用

python - 属性错误 : 'Worksheet' object has no attribute 'hide_gridlines'

python "IndexError: list index out of range"|目标 : Read 1 excel file & append data to a 2nd excel file

python - GroupBy 结果到列表字典

Python的 `email.message.as_string`将某些部分编码为base64;不清楚为什么

python - Scrapy spider Crawled pages 和 Scraped items 的区别

excel - 测试列范围内的 2 个值,直到在不同列中达到空白单元格

c# - 以编程方式更改 Excel 中的宏文本