Run the Python sample applications
Once code sample files are copied, do the following to prepare and run the Python sample applications.
Running the Python sample applications requires one of the following Python versions with NumPy and Pip Installs Packages (PIP) installed:
-
3.7.xx
-
3.8.xx
-
3.9.xx
In the above version numbers, xx covers any of the subversions.
-
Use PIP to uninstall any old version of the Python package:
python -m pip uninstall omnipage
-
In the CSDK binary folders, find the .whl file matching your
Python version (that is, the major and minor version numbers are part of the
file name). For example, for Python versions 3.7.xx, this is the following
file:
/usr/local/lib/omnipage-csdk-lib64-22.0/Python/37/omnipage-22.0-cp37-cp37m-linux_x86_64.whl
-
Use PIP to install the package from the above .whl file.
python -m pip install /usr/local/lib/omnipage-csdk-lib64-22.0/Python/37/omnipage-22.0-cp37-cp37m-linux_x86_64.whl
The .whl package provides a calling interface, that automatically searches for the appropriate CSDK binaries when calling kRecInit, RecInitPlus, or rPdfInit. Additionally, it provides type information for Python development environments. If the csdkPath extra parameter is not specified, the calling interface looks for the CSDK binaries at the default installation location (/usr/local/lib/omnipage-csdk-lib64-22.0).
-
To display the help built in the sample application, run the following
command:
python /usr/local/src/omnipage-csdk-22.0/python/PythonSamples.py -h
-
Run the required samples. To run all samples in a temporary folder
(tmp), use the following commands:
mkdir tmp python /usr/local/src/omnipage-csdk-22.0/python/PythonSamples.py -input /usr/local/src/omnipage-csdk-22.0/input -output tmp -all