Overview0

DevWare embeds Python as its built-in scripting language.
Within a Python script, access to the sensor and DevWare features is through built-in extension modules called devware and midlib. Functions that correspond to midlib API calls are in the midlib module. (Midlib is the library that does all I/O to the sensor including register access and acquiring images. See the midlib API document, MIDLib API Development Guide.pdf.) All other functions are in the devware module. The reason for the split is so a stand-alone midlib Python extension module may be created in the future that uses the same syntax. This work is scheduled for the 4.0 release.
To enable Python in DevWare install Python 3.1.1 from http://www.python.org/download. It can also be installed from http://www.aptina.com/support/Devsuite.jsp under the link "Python library".
There is a simple Python console window in DevWare. On the main window select the menu View ? Python Console. The output from executing Python code appears in the upper text box. Commands for immediate execution may be entered in the lower edit box. The command entry window keeps a command history; use the up and down arrows to select a previous command.
The usual way to run Python code within DevWare is to put the code in an ini file and execute it like any other ini file preset. It's also possible to send code to the Python interpreter through the COM interface and from a plug-in.
To run embedded Python from the COM interface, use the RunPython() method. See the DevWare COM Interface document, DevWare COM Development Guide.pdf.
To run embedded Python from a plug-in, use the RunPython() callback. See the Plugin Dialog Development Guide.pdf document.