コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
 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