Open binary file in Python

with open(“filename.txt”, “rb”) as fs: for line in fs: print(line)

Remarks: Even though lines are a concept of text files, it works with binary files too.

Know more: