var = tkMessageBox.askyesno('Title', 'Your question goes here?')
filename = 'log.txt'
f = open(filename, 'w')
f.write(str(var))
print(str(var) + ' has been written to the file ' + filename)
f.close()
How to create a message box with tkinter?