def write_to(file_path):
__def write(string):
____with open(file_path, '+a') as f:
______f.write(string + '¥n')
__return write

write = write_to("foo.txt")
write("foo")
write("bar")