Reading a binary file with python

后端 未结 6 1458
天涯浪人
天涯浪人 2020-11-27 12:12

I find particularly difficult reading binary file with Python. Can you give me a hand? I need to read this file, which in Fortran 90 is easily read by

int*4          


        
6条回答
  •  渐次进展
    2020-11-27 13:17

    You could use numpy.fromfile, which can read data from both text and binary files. You would first construct a data type, which represents your file format, using numpy.dtype, and then read this type from file using numpy.fromfile.

提交回复
热议问题