GNU Dico Manual (split by node):   Section:   Chapter:FastBack: Modules   Up: Modules   FastForward: Interface   Contents: Table of ContentsIndex: Concept Index

5.6 Python

The python module provides an interface which allows programmers to write loadable modules in Python. The syntax for loading the module is:

load-module name {
  command "python"
          " init-script=name"
          " load-path=path"
          " root-class=name";
}

All parameters are optional:

python module: load-path=path

Augments the default search path for Python modules. The format of path is the usual UNIX path specification: a colon-separated list of directory names.

python module: init-script=name

Specifies the name of the initial Python source file. This file will be loaded and interpreted immediately after loading the module.

python module: root-class=name

Sets the name of the Python root class, which is responsible for the dictionary operations.

A particular instance of the python module is loaded using the handler statement within a database block. This statement takes the same parameters as described above, plus any number of command line arguments, which will be passed to the root class constructor.