How do you make Python (any Python) know about PyUno in LibreOffice?
When I do:
import uno
python says that it knows no module "uno". (This question came up re. this question.)
Open a new document in Writer. Select menu Tools ▸ Macros ▸ Run macro..., the "Macro Selector" dialog appears. In the Library section select LibreOffice Macros ▸ HelloWorld, in the Macro Name section select HelloWorldPython, and click button Run. If you see this result, your system can run Python macros.
Introduction. The Python-UNO bridge allows to. use the standard OpenOffice.org API from the well known python scripting language. to develop UNO components in python, thus python UNO components may be run within the OpenOffice.org process and can be called from Java, C++ or the built in StarBasic scripting language.
(UPDATING for 2014's)
Perhaps the most used UNO application is document conversion... For this task, in nowadays, you not need UNO, you can use directly
libreoffice --convert-to
About UNO itself, see the new home page, http://api.libreoffice.org/
A good example of using python3-uno
(or python-uno
) is the Docvert conversor (Docvert for py2).
As said in the response to your comment there: it's an optional installable component for OpenOffice. See the Introduction to Python on OOo page in OpenOffice's Wiki for installation details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With