PythonScript Xojo Plugin

PythonModule Class (console safe)

A class that represents a Python module.

PythonObject
   PythonModule

class PythonModule

Properties

Name (Inherited) (console safe) Returns the name of the object.

Methods

BooleanField (console safe) Gets or sets a boolean field on the module
DeleteAttribute (console safe) Deletes attribute from the Python module.
DoubleField (console safe) Gets or sets a double field on the module
GetClass (console safe) Gets a class declaration by name from the module
GetFunction (console safe) Gets a function by name from to execute from the class module.
HasAttribute (console safe) Checks if the module has attribute with a given name
Int64Field (console safe) Gets or sets a Int64 field on the module
IntegerField (console safe) Gets or sets a integer field on the module
ObjectField (console safe) Gets or sets a object field on the module. Object field here means that Xojo or Real Studio object gets stored in a Python script
Reload (console safe) Reloads same module again if it has changed for example. Python caches the modules so loading it again in same way as the first time would not work.
StringField (console safe) Gets or sets a string field on the module
UInt64Field (console safe) Gets or sets a Int64 field on the module

Examples

You can get instances of this class by calling PythonScript.GetModule

PythonScript.AddSearchPath(f)

package = PythonScript.GetModule("OurModule")

if package <> nil then
    // OurModule loaded
else
    // OurModule did not load
end if

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