[question] How can I receive midi data from loop midi?

I have a motion capture suit glove that exports its sensors positional data as midi values. I have been capturing this data through pygame for a program that I have recently translated to c for speed. I am now trying to rebuild its functionality and was wonder what some options for receiving midi data were?

I have also played with the idea of receiving the data in python and piping it to the c program, but I haven’t had luck communicating between the two languages.