I’ve been given the task of connecting my code (fortran) with py (2.5), and generate a number of excel reports if possible. The first part went fine – and is done with, but now I’m working on the second.
What are my choices for making excel (2007 if possible) sheets from python ? In general, I would need to put some array values in them in a table (formatting doesn’t matter), and draw a number of charts from those tables. Is there a way to do this automatically ? Some library ?
Anyone done something like this in the past ?
You’re simplest approach is to use Python’s csv library to create a simple CSV file. Excel imports these effortlessly.
Then you do Excel stuff to make charts out of the pages created from CSV sheets.
There are some recipes for controlling Excel from within Python. See http://code.activestate.com/recipes/528870/ for an example. The example has references to other projects.
Also, you can use pyExcelerator or xlwt to create a more complete Excel workbook.