code: def writelines(lines, filename, encoding='utf-8', mode='wb'):
      
      return write(os.linesep.join(lines), filename, encoding, mode)
docs: Write 'lines' to file ('filename') assuming 'encoding'
      Return (eventually new) encoding