PythonScript Xojo Plugin

PythonScript Class (console safe)

A class that encapsulates the Python 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.

Object
   PythonScript

class PythonScript

Methods

shared AddSearchPathAdds search path for where Python will load custom modules from.
shared ClearErrorClears the error indicator, making ErrorOccurred return false again.
shared ErrorOccurredReturns true if error has occurred, else false.
shared FinalizeCall 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 GetErrorGets the error message if the ErrorOccurred property indicates there was a error.
shared GetModuleGets a python module, looking for it at Pythons default path and custom paths.
shared InitCall this method to initialise the Python engine for your application. This variation takes application name as parameter. Your application must initialise Python before doing anything else with Python.
shared InitCall this method to initialise the Python engine for your application. This variation takes no parameter. Your application must initialise Python before doing anything else with Python.
shared PythonIsFoundChecks if valid Python installation is found.
shared RegisterXojoModuleRegisters a Xojo module to expose to python.
shared SetConsoleOutputUse this method to register a redirect of console output from Python scripts.
shared SetErrorUse this method to raise a error.

Constants

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

Supported Platforms:

  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM