I would like to code in c ,but use the value in python by compile the c source file to .so file.
The ctypes library is probably the easiest way to do this.