My code
with open('car.FT','r', encoding="utf-8",errors='ignore') as h:
for line in h:
print(line)
File "car.FT" is output of Fourier transform that has complex values stored.It is written through a C program but I want to open this file in python. The output is not readable with this above piece of code used. The file is written in C :
typedef struct complex { /* Define a complex type */
float r,i; /* Real and imaginery parts */
} COMPLEX;
/* buffer for input image being converted into complex type */
COMPLEX IN_BUF[ROWS][COLS];
///PROCESSING ON IN_BUF////
fwrite(IN_BUF, sizeof(COMPLEX), ROWS*COLS, fout);
Here below is the data actually in the file. That I want to read.
I want to read this above file data in python.
