code: def write_file(fname, *lines):
      'write lines to a file'
      yield 'touch {}'.format(fname)
      for line in lines:
          yield "echo {} >> {}".format(line, fnamef write_file(fname, *lines):
      'write lines to a file'
      yield 'touch {}'.format(fname)
      for line in lines:
          yield "echo {} >> {}".format(line, fname)
docs: write lines to a file