def _savecuts(self, event=None): root = Tk() root.withdraw() csvfile = asksaveasfile(mode='w',defaultextension='.csv',title='Choose a file to save cuts to') root.destroy() if csvfile: pd.DataFrame(self.gpacuts).to_csv(csvfile)
def save(self): fp = tkinter_tkfiledialog.asksaveasfile(mode='wb', initialdir=self.dirname, **self.file_type_opt) if fp is None: return with fp: self.dirname = os.path.dirname(fp.name) fp.write(self.output)
def _savegrades(self, event=None): sorted_students = self.student_list.sort_values(by=['Last','First']) print(sorted_students) root = Tk() root.withdraw() csvfile = asksaveasfile(mode='w',defaultextension='.csv',title='Choose a file to save grades to') root.destroy() if csvfile: sorted_students.to_csv(csvfile)
def _saveimport(self, event=None): root = Tk() root.withdraw() csvfile = asksaveasfile(mode='w',defaultextension='.csv',title='Choose a file to save registrar import to') root.destroy() if csvfile: sorted_students = self.student_list.sort_values(by=['Last','First']) finalgrades = pd.DataFrame() finalgrades['Name'] = sorted_students['Last'] + ', ' + sorted_students['First'] finalgrades['EID'] = sorted_students.index finalgrades['Grade'] = sorted_students['Grades'] finalgrades['Absences'] = '' finalgrades['Remarks'] = '' finalgrades['Unique'] = sorted_students['Class'] finalgrades.to_csv(csvfile, sep='\t', index=False, encoding='utf-8')