How to run a python script?

How do you execute python scripts in libreoffice (calc)?

Opening Tools > Macros > Organize Macros > Python brings up this dialog

image

but every button is grayed out.

Someone mentioned APSO extension, but I thought that libreoffice supports now python natively.

1 Like

You may run them, but there is neither an editor or IDE nor any direct support to administer the scripts. If you don’t wish to place your file directly in the profile, try APSO.
.
“Official Help”:
https://help.libreoffice.org/latest/en-US/text/sbasic/python/python_ide.html?DbPAR=BASIC#bm_id761543349138561

Btw: Even the help on python seems to be linked “below” /sbasic/
.
Edit:
There is also a wiki-page available on the setup of several IDEs like geany or PyCharm to support development.
https://wiki.documentfoundation.org/Macros/Python_Design_Guide

2 Likes

Thank you, I’ve tried it (this tutorial was immensely helpful: 📌 Run Python Script in LibreOffice 📌 - YouTube), but at the end I didn’t have any autocompletion in my IDE. Do you know if there is any way to set it up? Otherwise, I’m not sure how do you know what methods or properties are available on each object?

Yes, for obvious reasons python-IDE don’t “find” types/definitions for projects in other languages without manual work.
.
As you opened a sepearate question and vib has already answered I will just link there:

1 Like

LibreOffice Python Script Modern Code Editor Examples was just updated.
I think this is a good start.

1 Like