Hi

I have a binary file of 32-bit unsigned integers. I want to read all those 
integers into a list.

I have:

    ulData = []
    with open(ulBinFileName, "rb") as inf:
        ulData.append(struct.unpack('i', inf.read(4)))

This obviously reads only one integer from the file.  How would I modify this 
code to read all integers from the file please?

Best regards

David

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to