def write_zfile(file_handle, data, compress=1):
 file_handle.write(_ZFILE_PREFIX)
 length = hex_str(len(data))
 file_handle.write(asbytes(length.ljust(_MAX_LEN)))
 file_handle.write(zlib.compress(asbytes(data), compress))

def write_zfile ( file_handle , data , compress = 1 ) : file_handle . write ( _ZFILE_PREFIX ) length = hex_str ( len ( data ) ) file_handle . write ( asbytes ( length . ljust ( _MAX_LEN ) ) ) file_handle . write ( zlib . compress ( asbytes ( data ) , compress ) )
write the data in the given file as a z-file .