def handleOpen(*args):
global fname
name=tkFileDialog.askopenfilename(filetypes=[('text', '.txt')])
if(name):
if(name!=fname):
with open(name, 'r') as f:
fname=name
try:
editBox.delete(START, END)
except:
pass
editBox.insert(START, f.read())
top.wm_title("Constrained Writer: "+fname)
editBox.mark_set("matchStart", START)
editBox.mark_set("matchEnd", START)
handleKeyActivity()
评论列表
文章目录