Skip to content

yushulx/python-ctypes-barcode-shared-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Ctypes for Dynamsoft Barcode Shared Library

An experiment demonstrates how to load and use Dynamsoft Barcode shared libraries by Python Ctypes.

Why Ctypes?

Dynamsoft Barcode Reader for Python is implemented using CPython and has been released to pypi.org:

pip install dbr

The reason behind using Ctypes is to try another way to invoke C APIs in shared libraries in pure Python.

Usage

  1. Build the CMake project bridge which is located in the root directory of the project.

    # Windows
    cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..
    cmake --build .
    
    # Linux
    cmake ..
    cmake --build .
  2. Get a valid license key from Dynamsoft website and update the line in success.py.

    DBR_InitLicense(instance, c_char_p('LICENSE-KEY'.encode('utf-8')))
  3. Run the success.py file.

    python success.py

Blog

Python Ctypes for Loading and Calling Shared Libraries

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published