def file_save():
    f = tkFileDialog.asksaveasfile(mode='w', defaultextension='.txt')
if f is None:
    return
text2save = str(text.get(1.0, END))
f.write(text2save)
f.close()
Save File Dialog in Tkinter