Main system done in C, external function in Python