Last active
March 10, 2019 03:14
-
-
Save michael-iuzzolino/b33d8cdc9bc57cfabb535e227392ebf1 to your computer and use it in GitHub Desktop.
clib python script for ctypes example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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