def load_new(self): fl = askopenfilename(filetypes=[(k, '*.%s' % k) for k in MTYPES], title='Choose music') if not fl: return self.title_label['text'] = os.path.split(fl)[1] self.opened = MTYPES.get(fl.split('.')[-1])(fl) self.d = UpdatingDict(self.opened) for k in self.ignore: self.d.pop(k, None) try: self.gdict.destroy() except AttributeError: pass self.gdict = GUIDict(self, self.d) self.gdict.pack(side=TOP, expand=True, fill=BOTH) return True