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