CODE.c
, and the header, CODE.h
, files.o
then compile the shared object, .so
, file: bash gcc -c -fPIC CODE_FILE.c -o CODE_FILE.o && \ gcc CODE_FILE.o -shared -o SHARED_OBJECT.so
.so
, file: bash gcc -shared -o SHARED_OBJECT.so -fPIC CODE_FILE.c
ctypes
in python: python from ctypes import *
python C_FUNCTIONS = CDLL('./SHARED_OBJECT.so')
python C_FUNCTIONS.functionName(arg1, arg2, ...)
Notes on Computers
AWS · Bash · C · C++ · Cyber Security · Git · LaTeX · Linux · Networking · Python · Raspberry Pi · Tools · Vim
Notes on Math & Physics
Information Theory · Linear Algebra · Solid State Physics
Copyright 2021 · Eric D. Weise