I am starting to learn Python with an online guide, and I just did an exercise that required me to write this script:
from sys import argv script, filename = ar
How about
target.write('%s \n %s \n %s' % (line1,line2,line3))