def get_keccak_hash(input_string, output):
    """Outputs 32-byte Keccak hash of given string."""
    hash = keccak(text=input_string)

    with smart_open(output, 'w') as output_file:
        output_file.write('0x{}\n'.format(hash.hex()))
Outputs 32-byte Keccak hash of given string.
ethereumetl/cli/get_keccak_hash.py