Python3Script Xojo Plugin |

# Python3Script Class (console safe)

A class that encapsulates the Python 3 script engine. You should not create instance of this class. Its a singleton class and all its functions are static and can be called without instance.
Note:
Always do if check on Python3Script.PythonIsFound to see if Python is installed before using any method in this class.

Object
Python3Script

class Python3Script

#### Methods

shared AddSearchPath | Adds search path for where Python will load custom modules from.
shared ClearError | Clears the error indicator, making ErrorOccurred return false again.
shared ErrorOccurred | Returns true if error has occurred, else false.
shared Finalize | Call this method to clean up resources that the Python engine used. Your application should normally call this when it shuts down if it has used Python.
shared GetError | Gets the error message if the ErrorOccurred property indicates there was a error.
shared GetModule | Gets a python module, looking for it at Pythons default path and custom paths.
shared Init | Call this method to initialise the Python engine for your application. This variation takes no parameter.
shared Init | Call this method to initialise the Python engine for your application. This variation takes application name as parameter.
shared PythonIsFound | Checks if valid Python installation is found. Optionally a constant can also be passed in to hint which version of Python is preferred if Python has not already been loaded.
shared RegisterXojoModule | Registers a Xojo module to expose to python.
shared SetConsoleOutput | Use this method to register a redirect of console output from Python scripts.
shared SetError | Use this method to raise a error.
shared SetPythonPath | Sets alternate path where to look for Python.

#### Enumerations

PreferredVersionValues | Enum which can optionaly be used in the Python3Script.PythonIsFound shared function.

#### Constants

PY_NO_ERROR = 0 |
PY_ERROR_COULD_NOT_CONVERT = 1 |
PY_ERROR_INDEX_OUT_OF_BOUNDS = 2 |
PY_NIL_PARAM_ERROR = 3 |

#### Important installation information:

Note that on Windows systems to be able to test both 32 bit and 64 bit on same machine then I had to first install 64 bit Python from the python-3.4.3.amd64.msi, and then python-3.4.3.msi, selecting other path for the 2nd one and unchecking register extensions. I tried first to do it the other way, 32 bit first and then 64 bit but could not get that to work, maybe it is possible though.

#### Supported Platforms:

- macOS Intel 64 bit
- macOS Apple Silicon
- Windows 32 bit
- Windows 64 bit
- Windows ARM 64 bit
- Linux 32 bit
- Linux 64 bit
- Linux ARM 32 bit
- Linux ARM 64 bit