- Lately I have been working on Ctypes. I have a
.C
file let me call itABC.C
. - It has many functions I just need to call this
Algorithm_Interface
function in python usingCtypes
. - I tried using
gcc
to create a.so
(like a library file) filefrom geeks for geeks
source .gcc -fPIC -shared -o libfun.so ABC.c
- And by using that command , in the
.C
source file directory. A.so
file is created(libfun.so).
In python I used this code to call that function:
import ctypes
f=open( "data.txt","r")
Raw_file=f.read()
fun = ctypes.CDLL("D:/NR/SPO2/libfun.so")
fun.Algorithm_Interface.argtypes = [ctypes.c_int]
returnVale = fun.Algorithm_Interface(Raw_file)
While I try to run it it returns a error.
[WinError 193] %1 is not a valid Win32 application
how to solve this.?