14 Python developers
111
14
Python developers
Note
There is no separate manual available for the Python API right now. For documentation please refer to the
C++ manual instead. Almost everything stated there will be valid for Python as well!
14.1
Introduction
As supporting all the various distributions and versions of Python out there with a binary interface is almost impos-
sible the mvIMPACT acquire Python API needs to be compiled for a specific version of Python it shall be used with.
Because of that what is shipped at the moment is source code that has been generated using
SWIG
which before
using it requires a compilation operation.
This requires a compiler matching the version of Python that shall be used. E.g. to use mvIMPACT Acquire with
Python 2.7 on Windows systems requires Visual Studio 2008. Additional information about the compiler that works
for a particular Python version on a particular platform can be found online. See e.g.
•
https://docs.python.org/2/extending/building.html
•
https://wiki.python.org/moin/WindowsCompilers
Note
Microsoft provides free-of-charge a 'Microsoft Visual C++ Compiler for Python 2.7' which can be used to
compile 'mvIMPACT Acquire for python'
for Python versions 2.7 to 3.2
:
https://www.microsoft.com/en-us/download/details.aspx?id=44266
The use of this compiler packet has been tested by MATRIX VISION and it is is highly recommended.
When installing the mvIMPACT Acquire Python API on a target system all files needed for building the actual
extension module can be found in
/mvIMPACT_Python
.
14.2
Building
During the compilation process Pythons
distutils
package will be used
14.2.1
Windows
On Windows systems running
/mvIMPACT_Python/compileWrapperCode.bat
will build and install the Python
API in the
site-packages
sub-folder of your Python installation provided a matching compiler could be found.
Note
The script will assume the Python interpreter can be found in the systems
Path
variable. If this is not the case
you need to append the path to the directory containing
Python.exe
to this variable either permanently
using the Systems environment variable dialog or temporary within the command shell you are calling the
script from like this:
set Path=%Path%;C:\Python27
compileWrapperCode.bat
The command shell your are calling the compilation script from depending on the version of Windows you
are working with and the folder you have installed the mvIMPACT Acquire package to might require elevated
rights thus you might need to start the command shell with the
Run as administrator
option.
MATRIX VISION GmbH
Содержание mvHYPERION-32R16
Страница 1: ...mvHYPERION Series Technical Manual...
Страница 16: ...12 CONTENTS MATRIX VISION GmbH...
Страница 17: ...5 1 European Union Declaration of Conformity statement 13 MATRIX VISION GmbH...
Страница 38: ...34 CONTENTS 8 1 2 9 Digital I Os Figure 10 Trigger In mvHYPERION CLx MATRIX VISION GmbH...