def work_decode(source, destination, key):
    '''Does decoding.

    Creates buffers.
    Generates "quick key."
    Decodes source to buffer.
    Writes buffer to destination.
    Closes files.'''
    new_file = ''
    decode_key = range(256)
    for index in range(256):
        decode_key[key[index][1]] = key[index][0]
    for line in source:
        for byte in line:
            new_file += chr(decode_key[ord(byte)])
    destination.write(new_file)
    source.close()
    destination.flush()
    destination.close()
Does decoding.

    Creates buffers.
    Generates "quick key."
    Decodes source to buffer.
    Writes buffer to destination.
    Closes files.
recipes/Python/456374_Crypt/recipe-456374.py