- Location of Python scripts
- The Python script files are simply stored within the file system.
-
+ Python scripts Organization and Location
+ The Python script files are stored in the file system, in folders controlled by %PRODUCTNAME. The macros can be stared at installation, user or file level.
- %PRODUCTNAME installation share
- %PRODUCTNAME user profile
- Embedded in the document
+
Python Script Locations
+
%PRODUCTNAME Macros container
+ Existing macros in this location (container) were copied by the installation program and are available to every computer user, and any open document can access macros stored the container. You need administrative rights to store or edit macros here.
+
+ The LibreOfficeDev Macros container location in the file system depends on the operating system:
+
+
+ For Windows, C:\Program Files (x86)\LibreOffice\Basis\share\Scripts\python.
+
+
+ For Linux and macOS, in $(Installation)/share/Scripts/python.
+
+
+
My Macros
+ This container is accessible only by the %PRODUCTNAME user. Any open document can access macros stored the container. Macros in this location are stored in the %PRODUCTNAME user profile.
+ The My Macros container location is in the user space and depends on the operating system:
+
+
+ For Windows, in C:\Users\current-user\AppData\Roaming\libreoffice\4\user\Scripts\python.
+
+
+ For Linux and macOS, in $(HOME)/.config/libreoffice/4/user/Scripts/python.
+
+
+
Document macros
+ Document macros are embedded in the document and are accessible only when the document is open.
+
Libraries, Modules and Macros
+ Like BASIC macros, Python macros can organized in libraries, modules and macros. Note that a module may not be part of a library.
+
Creating a Python Library
+ 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.
+
Creating a Python Module.
+ A module is a python file in the library or the container. Create a module adding a file in the container.
+