def save_as(self, event=None): path = tkFileDialog.asksaveasfilename() if path: data = self.text.get("1.0", 'end') f_ = open(path, "wb") f_.write(data) f_.close() return
def save_as(self, event=None): path = tkFileDialog.asksaveasfilename(title='w', filetypes=( ("Text file", "*.txt"), ("All files", "*.*"))) if path: data = self.text.get("1.0", 'end') f_ = open(path, "w") f_.write(data) f_.close() return
def save_file(self, event=None): if not self.text.storeobj['OpenFile']: path = tkFileDialog.asksaveasfilename() else: path = self.text.storeobj['OpenFile'] if path: data = self.text.get("1.0", 'end') f_ = open(path, "wb") f_.write(data) f_.close() self.text.storeobj['OpenFile'] = path return