Base64 file encode and decode with Python

From PedrosBrainDump

Encode code

import base64

input_file_path = input('Input file > ')
output_file_path = input('Output file > ')

with open(input_file_path, 'rb') as file:
    file_data = file.read()
    encoded_data = base64.b64encode(file_data)

with open(output_file_path, 'wb') as output_file:
    output_file.write(encoded_data)

Decode code

import base64

input_file_path = input('Input file > ')
output_file_path = input('Output file > ')

with open(input_file_path, 'rb') as encoded_file:
    encoded_data = encoded_file.read()
    decoded_data = base64.b64decode(encoded_data)

with open(output_file_path, 'wb') as output_file:
    output_file.write(decoded_data)