Read from a file opened in binary mode.
(file_path)
| 173 | |
| 174 | |
| 175 | def read_binary(file_path): |
| 176 | """Read from a file opened in binary mode.""" |
| 177 | with open(file_path, 'rb') as fh: |
| 178 | return fh.read() |
| 179 | |
| 180 | |
| 181 | def write_file(file_path, text, line_endings=None): |