Source string Source string

Context English Actions
main0000.xhp
hd_id901655365903313
help.text
%PRODUCTNAME Python Modules
main0000.xhp
par_id21655367848705
help.text
<link href="text/sbasic/python/python_screen.xhp" name="msgbox module"><literal>msgbox</literal> module</link>
main0000.xhp
par_id801655368030968
help.text
<link href="text/sbasic/shared/03/lib_ScriptForge.xhp" name="scriptforge module"><literal>scriptforge</literal> module</link>
main0000.xhp
par_id12655637848750
help.text
<link href="text/sbasic/python/python_programming.xhp#uno" name="uno module"><literal>uno</literal> module</link>
python_2_basic.xhp
tit
help.text
Python to Basic
python_2_basic.xhp
N0330
help.text
<bookmark_value>Python;Calling Basic</bookmark_value> <bookmark_value>ParamArray</bookmark_value>
python_2_basic.xhp
N0331
help.text
<variable id="py2ba_h1"><link href="text/sbasic/python/python_2_basic.xhp" name="Calling Basic macros from Python">Calling Basic Macros from Python</link></variable>
python_2_basic.xhp
N0332
help.text
You can call %PRODUCTNAME Basic macros from Python scripts, and notable features can be obtained in return such as:
python_2_basic.xhp
N0333
help.text
Simple logging facilities out of <literal>Access2Base</literal> library Trace console,
python_2_basic.xhp
N0334
help.text
<literal>InputBox</literal> and <literal>MsgBox</literal> screen I/O functions based on Basic to ease Python development,
python_2_basic.xhp
N0335
help.text
<literal>Xray</literal> calls interrupting Python script execution to help inspect variables.
python_2_basic.xhp
N0336
help.text
The %PRODUCTNAME Application Programming Interface (API) Scripting Framework supports inter-language script execution between Python and Basic, or other supported programming languages for that matter. Arguments can be passed back and forth across calls, provided that they represent primitive data types that both languages recognize, and assuming that the Scripting Framework converts them appropriately.
python_2_basic.xhp
N0337
help.text
It is recommended to have knowledge of Python standard modules and %PRODUCTNAME API features prior to perform inter-language calls from Python to Basic, JavaScript or any other script engine.
python_2_basic.xhp
N0338
help.text
When running Python scripts from an Integrated Development Environment (IDE), the %PRODUCTNAME-embedded Basic engine may be absent. Avoid Python-to-%PRODUCTNAME Basic calls in such contexts. However Python environment and Universal Networks Objects (UNO) are fully available. Refer to <link href="text/sbasic/python/python_ide.xhp" name="Setting Up an Integrated IDE for Python">Setting Up an Integrated IDE for Python</link> for more information.
python_2_basic.xhp
N0339
help.text
Retrieving %PRODUCTNAME Basic Scripts
python_2_basic.xhp
N0340
help.text
%PRODUCTNAME Basic macros can be personal, shared, or embedded in documents. In order to execute them, Python run time needs to be provided with Basic macro locations. Implementing the <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html" name="XScriptProvider interface">com.sun.star.script.provider.XScriptProvider</link> interface allows the retrieval of executable scripts:
python_2_basic.xhp
N0341
help.text
<bookmark_value>API;script.provider.MasterScriptProviderFactory: Retrieving Basic scripts</bookmark_value><bookmark_value>API;script.provider.XScript: Executing Basic scripts</bookmark_value><bookmark_value>API;XScriptProvider: Retrieving Basic scripts</bookmark_value>
python_2_basic.xhp
N0347
help.text
'''Grab Basic script object before invocation.'''
python_2_basic.xhp
N0363
help.text
Executing %PRODUCTNAME Basic Scripts
python_2_basic.xhp
N0364ndx
help.text
<bookmark_value>API;script.provider.XScript : Executing Basic scripts</bookmark_value>
python_2_basic.xhp
N0364
help.text
The %PRODUCTNAME Software Development Kit (SDK) documentation for <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html#a11a551f5a2520f74c5109cd8c9f8c7b7" name="XScript interface">com.sun.star.script.provider.XScript</link> interface details the calling convention for inter-language calls. Invocation of functions requires three arrays:
python_2_basic.xhp
N0365
help.text
the first lists the arguments of the called routine
python_2_basic.xhp
N0366
help.text
the second identifies modified arguments
python_2_basic.xhp
N0367
help.text
the third stores the return values
python_2_basic.xhp
N0368
help.text
Python Syntax
python_2_basic.xhp
N0372
help.text
Examples of Personal or Shared Scripts
python_2_basic.xhp
N0373
help.text
Examples in <link href="text/sbasic/python/python_screen.xhp" name="Input/Output to Screen">Input/Output to Screen</link> detail Python to Basic invocation calls. <link href="text/sbasic/python/python_document_events.xhp" name="Monitoring Document Events">Monitoring Document Events</link> illustrates the usage of *args Python idiom to print a variable number of parameters to <literal>Access2Base</literal> logging console dialog.
python_2_basic.xhp
N0374
help.text
At time of development you can interrupt Python script execution using <link href="https://berma.pagesperso-orange.fr/index2.html" name="Xray extension">Xray extension</link> in order to inspect properties and methods of UNO objects. The APSO extension debugger allows object introspection using either Xray either MRI extensions.
python_2_basic.xhp
N0378
help.text
Examples of Embedded Scripts in Documents
python_2_basic.xhp
N0379
help.text
<literal>*args</literal>Python simplified syntax can be used in conjunction with %PRODUCTNAME Basic routines that accept a variable number of arguments. Below <literal>Print</literal> and <literal>SUM</literal> Python functions call their Basic <literal>Print</literal> and <literal>SUM</literal> counterparts, using aforementioned <literal>getBasicScript</literal> function. Exception handling is not detailed.
python_2_basic.xhp
N0384
help.text
"""Outputs the specified strings or numeric expressions in a dialog box."""

Loading…

No matching activity found.
Browse all component changes

Glossary

English English
No related strings found in the glossary.

String information

Context
python_2_basic.xhp
N0340
help.text
Source string description
yiTqz
Flags
read-only
Source string location
python_2_basic.xhp
String age
3 years ago
Source string age
3 years ago
Translation file
templates/helpcontent2/source/text/sbasic/python.pot, string 24