def write(self, out):
    '\n        write to file with extension-awareness\n        '
    ext = os.path.splitext(out)[1][1:].lower()
    if (ext == 'xml'):
        self.writeXML(out)
    elif (ext == 'csv'):
        self.writeCSV(out)
    elif (ext == 'json'):
        self.writeJSON(out)
    else:
        print(('Format %s not recognized' % ext))
write to file with extension-awareness
def write(self, out):
    '\n        \n        '
    ext = os.path.splitext(out)[1][1:].lower()
    if (ext == 'xml'):
        self.writeXML(out)
    elif (ext == 'csv'):
        self.writeCSV(out)
    elif (ext == 'json'):
        self.writeJSON(out)
    else:
        print(('Format %s not recognized' % ext))