Return the binary contents of the pointed-to file as a bytes object:
Path.read_bytes()
>>> p = Path('my_binary_file') >>> p.write_bytes(b'Binary file contents') 20 >>> p.read_bytes() b'Binary file contents'