Not finding any info online; I hope somebody here knows. It was Python in OpenOffice; is it still Python? Or are they moving to gasp VBA?
I think this page answers your question. In summary, you can use the following:
But you can't write/edit Python scripts from LibreOffice IDE, just to run scripts.