I need to create Excel XML files from Python.
The Excel XML format is fairly simple. I looked at a a sample xml file saved from Excel 2003 and it is fairly simple.
I'm looking for a a Pythonic, ready made library to create such开发者_开发百科 xml files instead of reinventing one.
Something that I can use as below:
book = Expy.Workbook()
s1 = book.add_sheet()
s1[0, 2] = "A3"
s1[0, 0] = 12
s1[0, 9] = Expy.Formula("=Sum(A1:A3)")
book.write("excelfile.xml")
Anybody know of something like that?
xlwt seems outdated, supporting python 2.x only, and seems to write xls files, not xml.
give pythonOffice a try
If you are on windows with Excel installed, you could look into Excel Automation.
from win32com import client
excel_app = client.Dispatch("Excel.Application")
# check VBA documentation on automating excel...
xlwt will write Excel files from python, but I'm not sure if it handles the newer XML file formats. http://pypi.python.org/pypi/xlwt
精彩评论