Skip to content

Instantly share code, notes, and snippets.

@michael-iuzzolino
Last active March 10, 2019 03:14
Show Gist options
  • Save michael-iuzzolino/b33d8cdc9bc57cfabb535e227392ebf1 to your computer and use it in GitHub Desktop.
Save michael-iuzzolino/b33d8cdc9bc57cfabb535e227392ebf1 to your computer and use it in GitHub Desktop.
clib python script for ctypes example
import ctypes
# A. Create library
C_library = ctypes.CDLL("clib.so")
# B. Specify function signatures
hello_fxn = C_library.say_hello
hello_fxn.argtypes = [ctypes.c_int]
# C. Invoke function
num_repeats = 5
hello_fxn(num_repeats)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment