def addToFile(self): """ Save the name and the number of the contacts to a text file """ ac=AgendaController() group=raw_input('Group:').strip() while group<>'Family' and group<>'Friends' and group<>'Others': print 'INVALID GROUP' group=raw_input('Group:').strip() list=ac.lookUpAll(group) outFile=raw_input('FileName:').strip() try: ac.exportCSV(group, outFile) except IOError: print "File not found"