human
append to a file
assistant
Here is some code to append line "cool beans..." to file "foo"

with open('foo', 'a') as f:
    f.write('cool beans...')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.