Organització i ubicació dels scripts en Python
The Python script files are stored in the filesystem, in folders controlled by LibreOffice. The macros can be started at installation, user or file level.
Ubicacions dels scripts en Python
Refer to Getting Session Information in order to get programmatic access to Python script locations.
Contenidor Macros del LibreOffice
El programa d'instal·lació ha col·locat les macros existents a aquesta ubicació (contenidor). Estan disponibles per a tots els usuaris de l'ordinador, i qualsevol document obert pot accedir-hi. Vos calen privilegis administratius per a emmagatzemar o modificar macros a aquesta ubicació.
La ubicació del contenidor Macros del LibreOffice al sistema de fitxers depèn del sistema operatiu:
-
En el Windows: ${Instal·lació}\share\Scripts\python.
-
En el Linux i el macOS: ${Instal·lació}/share/Scripts/python.
Les meues macros
This container is accessible only by the LibreOffice user. Any open document can access macros stored the container. Macros in this location are stored in the LibreOffice user profile.
La ubicació del contenidor Les meues macros és a l'espai d'usuari i depèn del sistema operatiu:
-
En el Windows,
%APPDATA%\LibreOffice\4\user\Scripts\python. -
En el Linux i el macOS:
$HOME/.config/libreoffice/4/user/Scripts/python.
Macros de document
Document macros are embedded in the document and are accessible only when the document is open.
Biblioteques, mòduls i macros
Like BASIC macros, Python macros can be organized in libraries, modules and macros.
Creació d'una biblioteca de Python
Libraries are folders in the container tree. To create a library, add a folder in the target container. The library name is the folder name.
Creació d'un mòdul de Python.
A module is a python file in the library or the container. Create a module adding a file in the container.
Macros en Python
Una macro és un objecte del Python al mòdul.