This module encodes and decodes files in binhex4 format, a format allowingrepresentation of Macintosh files in ASCII. Only the data fork is handled.
Thebinhex module defines the following functions:
Convert a binary file with filenameinput to binhex fileoutput. Theoutput parameter can either be a filename or a file-like object (any objectsupporting awrite() andclose() method).
Decode a binhex fileinput.input may be a filename or a file-like objectsupportingread() andclose() methods. The resulting file is writtento a file namedoutput, unless the argument isNone in which case theoutput filename is read from the binhex file.
The following exception is also defined:
Exception raised when something can’t be encoded using the binhex format (forexample, a filename is too long to fit in the filename field), or when input isnot properly encoded binhex data.
See also
There is an alternative, more powerful interface to the coder and decoder, seethe source for details.
If you code or decode textfiles on non-Macintosh platforms they will still usethe old Macintosh newline convention (carriage-return as end of line).
As of this writing,hexbin() appears to not work in all cases.
19.6.base64 — RFC 3548: Base16, Base32, Base64 Data Encodings
19.8.binascii — Convert between binary and ASCII
Enter search terms or a module, class or function name.