Reading Binary File Content

  • Share this:

Code introduction


Read the content of a file as binary data and return it.


Technology Stack : Built-in file operations

Code Type : File operation

Code Difficulty :


                
                    
def zip_file(filename):
    with open(filename, 'rb') as f:
        content = f.read()
    return content