Beispiel #1
0
 def open_file(self, event=None):
     path = tkFileDialog.askopenfilename()
     if path:
         data = open(path, "rb").read()
         self.text.delete('1.0', 'end')
         self.text.insert("1.0", data)
         self.text.storeobj['OpenFile'] = path
     return
Beispiel #2
0
 def __init__(self, pad):
     self.text = pad
     path = tkFileDialog.askopenfilename()
     if path:
         self.s = open(path, 'r').read()
         self.insert_words()
     else:
         self.s = None