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.

Community
  • 1
  • 1
ofer.sheffer
  • 5,417
  • 7
  • 25
  • 26

1 Answers1

4

You would almost certainly be better off adding your formatting and doing other operations in python then saving as an Excel xml file.

Since AFAIK Excel is only available for Windows and Mac you are going to be out of luck trying anything like this on Linux. Why not do something similar for Open Office or Libra Office? There is also pySpread which will really whet your appetite.

Steve Barnes
  • 27,618
  • 6
  • 63
  • 73