

In a real project, it's probably best to organize into classes, but this is a simplified version.

If instead you are using an installation of Python on Windows that was not shipped with LibreOffice, then getting it to work with UNO is much more difficult, and I would not recommend it unless you enjoy hacking. "C:\Program Files\LibreOffice\program\python.exe" Next, run the installation of python that comes with LibreOffice, which has uno installed by default. Start soffice -accept=socket,host=localhost,port=2002 urp chdir "%ProgramFiles%\LibreOffice\program\" This can be done most easily on the command line or using a shell script, but it can also work with a system call using a time delay and subprocess. I don't use COM much, but I think this is the equivalent of the COM interaction you asked about. In order to interact with LibreOffice, start an instance listening on a socket. Os.environ += r" C:\Program Files\LibreOffice\program" Os.environ = r":C:\Program Files\LibreOffice\program\fundamental.ini" I've also tried this (unsuccessfully): Getting python to import uno / pyuno: import os Related forum post, and LibreOffice: Programming with Python Scripts, but the way uno should be installed on Windows, with Python, is not detailed also Detailed tutorial regarding LibreOffice to Python macro writing, especially for Calc

but something closer to a COM interaction (Component Object Model) would be useful for many applications, thus this question here Headless use of soffice.exe, see my question+answer Headless LibreOffice very slow to export to PDF on Windows (6 times slow than on Linux) and the notes on the answer: it "works" with soffice.exe -headless. I've searched extensively on this since a few days, but I haven't found a reproducible sample code working on Windows: docx document with LibreOffice UNO and export it to PDF? More generally, and as an example of use of UNO, how to open a. ModuleNotFoundError: No module named 'uno' Pip install unoconv and pip install unotools ( pip install uno is another unrelated library), but still I get this error after import uno:

I've installed LibreOffice (6.3.4.2), also This question is focused on Windows + LibreOffice + Python 3.
