Skip to content

Instantly share code, notes, and snippets.

@jaseg
Created January 9, 2015 01:06
Show Gist options
  • Save jaseg/5bdce1111ddf28c33647 to your computer and use it in GitHub Desktop.
Save jaseg/5bdce1111ddf28c33647 to your computer and use it in GitHub Desktop.
Extremely simple ctypes example
// compile with $ gcc -o test.so -shared test.c
int fnord(int a, int b){
return a+4*b-1;
}
import ctypes as ct
test = ctypes.CDLL('./test.so')
test.fnord(23, 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment