my_dict = {'example': [1, 2, 3]}
lines = ['{}|{}'.format(k, '|'.join(map(str, v))) for k, v in my_dict.items()]
print('\n'.join(lines))
my_dict = {'example': [1, 2, 3]}
lines = ['{}|{}'.format(k, '|'.join(map(str, v))) for k, v in my_dict.items()]
print('\n'.join(lines))
my_reconstructed_dict = {k: [int(i) for i in v.split('|')] for k, v in (i.split('|', maxsplit=1) for i in lines)}
assert my_reconstructed_dict == my_dict