I have a Python 2.6 app running on Linux that creates a CSV file. From the app, I need to create an HTML report, as a single HTML file, that presents the data from the CSV (probably as a table) and also highlights fields where the values meet certain criteria. Charting type functionality 开发者_如何转开发would be a nice to have.
What's the best way to do this?
No GPL stuff please.
Choose a Python csv library from here. Now that you have the data mapped to Python data structures you can iterate on it and create the html. I would use the Jinja2 templating engine which is nicely documented. Highlighting rows/cells would work by setting certain css classes on the respective tr/td elements in the table.
精彩评论