- Lately I have been working on Ctypes. I have a
.Cfile let me call itABC.C. - It has many functions I just need to call this
Algorithm_Interfacefunction in python usingCtypes. - I tried using
gccto create a.so(like a library file) filefrom geeks for geekssource .gcc -fPIC -shared -o libfun.so ABC.c - And by using that command , in the
.Csource file directory. A.sofile 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.?