def open_(event): path = askopenfilename() # If the user clicked 'Cancel', return without changing anything if not path: return with open(path, 'r+t') as infile: editor.add(Buffer(file=infile, text=infile.read())) editor.select('end')
def new(event): editor.add(Buffer()) editor.select('end')