Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

Idea:

  • In the main function we compile the functions mean.c and mean.h to a shared library, calling it libmean.so.1
  • this library gets loaded into memory with ctypes.CDLL(<name lib>)
  • the memory adress, and two floats get given to a c function that is bound with python through the python-c-api:
    • these are defined in demolib.c
    • these are connected with python using demomodule.c
  • within that c function, the memory adress is made into the pointer to the function that is contained in the loaded shared library.
  • This pointer is then called, with the two numbers and returns an output

usage:

in this directory: pip install . –upgrade

then run python main.py

Some leads: