I have a file.cc that contains an array of doubles values, as seen here:
double values[][4] = {
{ 0.1234, +0.5678, 0.1222, 0.9683 },
{ 0.1631, +0.4678, 0.2122, 0.6643 },
{ 0.1332, +0.5678, 0.1322, 0.1683 },
{ 0.1636, +0.7678, 0.7122, 0.6283 }
... continue
}
How can I export these values to a Python list?
I cannot touch these files because they belong to an external library, subject to modification. Exactly, I want to be able to update the library without affecting my code.
file.ccshould be some kind of C library to be used by a python program or an independent program? In case A you could check forctypes,cythonor write a small python C extension; in the second case you simply have to use some kind of IPC(exactly as if the python program was a different C program).