PyDocs

Nav

File and Directory Access

Path.read_bytes

pathlib

method of Path · Added in 3.5 (source)
  • Path.read_bytes()
Open the file in bytes mode, read it, and close the file.
1 Example
>>> p = Path('my_binary_file')
>>> p.write_bytes(b'Binary file contents')
20
>>> p.read_bytes()
b'Binary file contents'
from the Python docs
See Also
No see-alsos for pathlib/Path.read_bytes
0 Notes
No notes for Path.read_bytes