binhex

The binhex module is used to encode and decode files in binhex 4, a format commonly used when transferring files on older Macintosh systems.

binhex(input, output)

Converts a binary file with name input to a binhex file. output is a filename or an open file-like object that supports the write() and close() methods.

hexbin(input
						[,
						output])

Decodes a binhex file. input is either a filename or a file-like object with read() and close() methods. output is the name of the output file. If omitted, the output name is taken from the binhex file.

Exceptions

Error

Raised when data can’t be encoded as binhex format or when input can’t be properly decoded.

Notes

  • Both the data and resource forks are handled on the Macintosh.

  • Only the data fork is ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.