- A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of UNO objects functions or services, Python macros use the XSCRIPTCONTEXT UNO single object, shared with JavaScript and Beanshell. The g_exportedScripts global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another.
+ A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of UNO objects functions or services, Python macros use the XSCRIPTCONTEXT UNO single object, shared with JavaScript and BeanShell. The g_exportedScripts global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another.
XSCRIPTCONTEXT Global Variable
- Genuine Basic UNO facilities can be inferred from XSCRIPTCONTEXT global variable. Refer to %PRODUCTNAME API for a complete description of XSCRIPTCONTEXT. XSCRIPTCONTEXT methods summarize as:
+ Genuine Basic UNO facilities can be inferred from XSCRIPTCONTEXT global variable. Refer to %PRODUCTNAME API for a complete description of XSCRIPTCONTEXT. XSCRIPTCONTEXT methods summarize as:
@@ -77,9 +77,9 @@
Module import
XSCRIPTCONTEXT is not provided to imported modules.
- %PRODUCTNAME Basic libraries contain classes, routines and variables, Python modules contain classes, functions and variables. Common pieces of reusable Python or UNO features must be stored in My macros within <User Profile>/Scripts/python/pythonpath. Python libraries help organize modules in order to prevent module name collisions. Import uno.py inside shared modules.
+ %PRODUCTNAME Basic libraries contain classes, routines and variables, Python modules contain classes, functions and variables. Common pieces of reusable Python or UNO features must be stored in My macros within <User Profile>/Scripts/python/pythonpath. Python libraries help organize modules in order to prevent module name collisions. Import uno.py inside shared modules.
- Genuine BASIC UNO facilities can be inferred using uno.py module. Use Python interactive shell to get a complete module description using dir() and help() Python commands.
+ Genuine BASIC UNO facilities can be inferred using uno.py module. Use Python interactive shell to get a complete module description using dir() and help() Python commands.
@@ -202,7 +202,7 @@
- See Creating a Dialog
+ See Opening a DialogCreateUnoDialog()
@@ -210,7 +210,7 @@
- See Creating a Listener
+ See Creating a ListenerCreateUnoListener()
@@ -269,7 +269,7 @@
Importing an embedded Module
- Similarly to %PRODUCTNAME Basic that supports browsing and dynamic loading of libraries, Python libraries can be explored and imported on demand. For more information on library containers, visit %PRODUCTNAME Application Programming Interface (API) or download %PRODUCTNAME Software Development Kit (SDK).
+ Similarly to %PRODUCTNAME Basic that supports browsing and dynamic loading of libraries, Python libraries can be explored and imported on demand. For more information on library containers, visit %PRODUCTNAME Application Programming Interface (API) or download %PRODUCTNAME Software Development Kit (SDK).Importing a Python document embedded module is illustrated below, exception handling is not detailed:import uno, sys
@@ -295,7 +295,7 @@
- Basic UNO Objects, Functions and Services
+ Basic UNO Objects, Functions and Services
diff --git a/source/text/sbasic/python/python_screen.xhp b/source/text/sbasic/python/python_screen.xhp
index e6d1d89f44..755fd7a4f2 100644
--- a/source/text/sbasic/python/python_screen.xhp
+++ b/source/text/sbasic/python/python_screen.xhp
@@ -22,8 +22,8 @@
Input/Output to Screen
Python standard output file is not available when running Python macros from ... menu. Presenting the output of a module requires the Python interactive console. Features such as input(), print(), repr() and str() are available from the Python shell.
- The Alternative Python Script Organizer (APSO) extension offers a msgbox() function out of its apso_utils module.
- %PRODUCTNAME Basic proposes InputBox(), Msgbox() and Print() screen I/O functions. Python alternatives exist relying either on %PRODUCTNAME API Abstract Windowing Toolkit, either on Python to Basic function calls. The latter proposes a syntax that is intentionally close to that of Basic, and uses a Python module next to a Basic module. The API Scripting Framework is used to perform Basic, Beanshell, JavaScript and Python inter-languages function calls.
+ The Alternative Python Script Organizer (APSO) extension offers a msgbox() function out of its apso_utils module.
+ %PRODUCTNAME Basic proposes InputBox(), Msgbox() and Print() screen I/O functions. Python alternatives exist relying either on %PRODUCTNAME API Abstract Windowing Toolkit, either on Python to Basic function calls. The latter proposes a syntax that is intentionally close to that of Basic, and uses a Python module next to a Basic module. The API Scripting Framework is used to perform Basic, BeanShell, JavaScript and Python inter-languages function calls.
- Copy screen_io Python module in My macros within <UserProfile>/Scripts/python/pythonpath,
+ Copy screen_io Python module in My macros within <UserProfile>/Scripts/python/pythonpath,
- Copy uiScripts Basic module in My macros Standard Basic library,
+ Copy uiScripts Basic module in My macros Standard Basic library,Restart %PRODUCTNAME.
@@ -95,7 +95,7 @@
- Calling Basic macros from Python
+ Calling Basic macros from Python