| Customize Help

Importing required libraries and distribution of a MIL application in Python



The following section discusses the libraries required to develop MIL applications in Python. The section also discusses what is required to distribute MIL applications developed in Python.

Importing required libraries

To develop MIL applications in Python, you will need to import the MIL wrapper for Python and the ctypes library. The ctypes library is a foreign function interface for Python. It provides C compatible data types and is required to cast a variable to another data type not natively supported in Python. It is also required if you want to make use of pointers in Python.

To import the MIL wrapper and the ctypes library, use the following statements:

import mil as MIL
import ctypes

The MIL Python wrapper can be found in the "\Matrox Imaging\MIL\Scripting directory of your MIL installation.

Distribution

To run MIL applications developed in Python, your clients must have a valid MIL runtime installation, the MIL Python wrapper which is typically included in the MIL installation, and a Python interpreter for the version of Python used in your application. Note that the version of Python must be one supported by MIL.

To distribute a MIL application written in Python, follow the exact same instructions as when distributing a MIL application written in C/C++. For more information, see the Interactive redistribution using your custom DVD section of Chapter 54: Distribution and licensing. Make sure to include all your Python scripts and dependencies when distributing your application. If you intend to distribute your application with limited MIL/MIL-Lite DVD content, ensure that the Python wrapper is included in the distribution.