I have this code that creates a gui with value entry box. but how do I make the it write into file when I push the button?
from tkinter import *
from tkinter import messagebox
from tkinter import simpledialog
msg = messagebox
sdg = simpledialog
root = Tk()
w = Label(root, text="My Program")
w.pack()
msg.showinfo("welcome", "hi. ")
name = sdg.askstring("Name", "What is you name?")
age = sdg.askinteger("Age", "How old are you?")