def verify_fileds(self): # this funtion will check to # see if the fields or check # or not if not raise an erro message invisbale_button = self.invisbale_button.get() merge_button = self.merge_button.get() icon_button = self.icon_button.get() filename = self.entry_var.get() icon = self.icon.get() if filename.endswith(('.py','.pyw')): if invisbale_button == True and merge_button == True and icon_button == True: if icon.endswith('.ico'): # Calling the ain1 class a1 = Ain1(self.master,filename,icon) a1.merge() else: messagebox.showerror(parent=self.master,title='Icon Error',message="Icon file should end with a (.ico) extension") elif invisbale_button == 1 and merge_button == 1: # callign the inmerge class inmerge = Inmerge(self.master,filename) inmerge.merge() elif invisbale_button == True and icon_button == True: if icon.endswith('.ico'): #calling the inicon class inicon = Inicon(self.master,filename,icon) inicon.merge() else: messagebox.showerror(parent=self.master,title='Icon Error',message="Icon file should end with a (.ico) extension") elif merge_button == True and icon_button == True: if icon.endswith('.ico'): #calling the mergeicon class mergeicon = MergeIcon(self.master,filename,icon) mergeicon.merge() else: messagebox.showerror(parent=self.master,title='Icon Error',message="Icon file should end with a (.ico) extension") elif invisbale_button == True: #calling the hidden class hidden = Hidden(self.master,filename) hidden.merge() elif merge_button == True: #calling the merge class merge = Merge(self.master,filename) merge.merge() elif icon_button == True: messagebox.showerror(parent=self.master,title='Icon Error',message="Icon cannot be merged alone") else: messagebox.showerror(parent=self.master,title='Invalid Error',message="Please atleast select merge") else: messagebox.showerror(parent=self.master,title='Filename Error',message="File shoud end with a (.py or .pyw) extention.")
# 100 days of code day 24: mail merge. from merge import Merge letter = "./Input/Letters/starting_letter.txt" names = "./Input/Names/invited_names.txt" print("Running mail merge\n") merge = Merge(letter, names) count = merge.merge() print(f"Finished. Processed {count} records.")