我已经设法访问了LibreOffice.calc,打开了我的文件,选择了我的工作表以及getValue()和getFormula()...也就是说,我的工作(几乎)完成了,但是...PyUno桥只是一座桥,并不是很有Pythonic风格。
例如,for sheet in sheets:抛出以下异常:TypeError: 'pyuno' object is not iterable
那么,问题是,是否有人在某处拥有LibreOffice (计算)对象模型的开放源码Pythonic库?
off = LibreOffice()
calc = off.Open(file)
sheets = calc.getSheets()
for sheet in sheets:
print(sheet.name)
rng = sheet.Range("A1:C5")
...发布于 2015-02-06 17:25:36
下面是你应该做的事情:
sheets = calc.getSheets()
sheet_names = sheets.getElementNames()
for sheet_name in sheet_names:
print(sheet_name)
sheet = sheets.getByName(sheet_name)代码不会说谎:D
发布于 2013-10-03 04:08:11
目前还没有这样的事情。我一直在尝试这样的东西,我自己在这里工作,不清楚它是否会发布。我的方法是将doxygen输出作为代码生成器的输入,以创建一组包装器类,然后这些类甚至可以在python中实现用于测试帧。
https://stackoverflow.com/questions/15088308
复制相似问题