0

I've written a Python script that takes input files and outputs a CSV file. Next, I go into Excel and use conditional formatting to color some of the information (e.g. if A2=1, color background red) -- to keep the formatting I save it as *.xlsx (not sure this is a good idea, currently only tested in windows). This needs to be performed multiple times.

In short: I'd like to incorporate the second stage into the script and this needs to work both in windows and linux.

My thoughts: record an excel macro, have python open csv files and run that macro, then (save as...?) close file or keep it open (optional with command flag -k, --keep_open).

My search came up inconclusive looking for a solution applicable for both OS environments.

This looked close, but it seems windows-centric.

Thoughts/suggestions would be appreciated.

4

1 回答 1

4

在 python 中添加格式和执行其他操作然后保存为 Excel xml 文件几乎肯定会更好。

由于 AFAIK Excel 仅适用于 Windows 和 Mac,因此在 Linux 上尝试类似的操作会很不走运。为什么不对 Open Office 或 Libra Office 做类似的事情呢?还有pySpread会真正激发你的胃口。

于 2013-08-03T13:48:26.877 回答