python - How to detect EOF with numpy.fromfile -


i trying read in large (several gb) binary file numpy.fromfile(). reading in entire file @ once generates out of memory error, want create loop read , process n chunks of data @ time. following:

while true:    numpy.fromfile(f, recordtype, n)    # proccess data     if f.eof():         break 

how detect when have reached end of file, can break loop?

while true:    = numpy.fromfile(f, recordtype, n)    # proccess data     if a.size < n:         break 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -