def writelines(lines, filename, encoding='utf-8', mode='wb'):
 return write(os.linesep.join(lines), filename, encoding, mode)

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