About 293,000 results
Open links in new tab
  1. Reading a binary file with python - Stack Overflow

    Jan 3, 2012 · 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 n_particles, n_groups real*4 …

  2. Reading binary file and looping over each byte - Stack Overflow

    Reading binary file in Python and looping over each byte New in Python 3.5 is the pathlib module, which has a convenience method specifically to read in a file as bytes, allowing us to iterate …

  3. Reading integers from binary file in Python - Stack Overflow

    As of Python 3.2+, you can also accomplish this using the from_bytes native int method: file_size = int.from_bytes(fin.read(2), byteorder='big') Note that this function requires you to specify …

  4. Reading binary file in python - Stack Overflow

    for rec in inh: reads one line at a time -- not what you want for a binary file. Read 4 bytes at a time (with a while loop and inh.read(4)) instead (or read everything into memory with a single …

  5. python - Python3 reading mixed text/binary data line-by-line

    Sep 6, 2018 · Binary files still support line-by-line reading, where file.readline() will give you the binary data up to the next \n byte. Just open the file as binary, and read one line.

  6. How to open and read a binary file in Python? - Stack Overflow

    Jan 25, 2016 · I have a binary file (link) that I would like to open and read contents of with Python. How are such binary files opened and read with Python? Any specific modules to use for such …

  7. How to open and present raw binary data in Python?

    Oct 15, 2015 · In Python (preferably 3.x), I would like to know how I can open a file of an arbitrary type, read the bytes that are stored on disk, and present those bytes in their most 'native', …

  8. How to read Binary file on PYTHON from unknown encoding?

    Feb 13, 2018 · A = np.fromfile(file_id, 'uint16'); seems to work perfectly! This method was not in the helper of numpy : ( I have a second binary file but written in utf-8 encoding text (working …

  9. file - Reading binary data in python - Stack Overflow

    More Extensive Solution for Header Reading (Long) Because the binary data must be manually specified, this may be tedious to do in source code. You can consider using some …

  10. python - Reading a binary file into a struct - Stack Overflow

    I have a binary file with a known format/structure. How do I read all the binary data in to an array of the structure? Something like (in pseudo code) bytes = read_file(filename) struct = {'int','i...

Refresh