binhex.binhex(input, output): Convert a binary file with filename input to binhex file output. The output parameter can either be a filename or a file-like object (any object supporting a write() and close() method).
binhex.hexbin(input, output): Decode a binhex file input. input may be a filename or a file-like object supporting read() and close() methods. The resulting file is written to a file named output unless the argument is None in which case the output filename is read from the binhex file
The following exception is also defined :
excpetion binhex.error: Exception is raised whenever something cant be encoded using binhex format for example the file name is too long to fit in filename field or when input is not properly encodes in binhex format
infile = "file.txt"
The following file needs to converted with Binhex 4.0
To convert Hex into Binary
infile = "test.hqx"