I have a python script called analyze.py , i want to run this python script from another C program and use the result obtained? : The python script contains lots of libraries imported .

my C code so far :

# include < stdio.h>

# include < python2.7/Python.h>

void main(int argc, char *argv[])

{

    FILE* file;

    Py_SetProgramName(argv[0]);
          
    Py_Initialize();    
              
    PySys_SetArgv(argc, argv);

    file = fopen("analyze.py","r");

    PyRun_SimpleFile(file, "analyze.py");

    Py_Finalize();                      

    return;
}

Is there any other way that i can use so that even if any modification in arguments or number of python scripts i call inside c program increases the same code can be used with little changes ?

can i use system call and use the result obtained from it ?

thanks in advance