I just want to create a program, so that when I click the "Print" Button, it takes data from an entry field and outputs to a text field below. Is there something wrong with my usage of .get()
? Not exactly sure what's the problem?
import tkinter as tk
from tkinter import *
wd=tk.Tk()
def inkq():
string= str(nd.get())
ketqua.insert(END, string)
nd=Entry(wd).pack()
btn=Button(wd, text ="Print", command = inkq).pack()
btn1=Button(wd, text ="Quit", command = wd.destroy).pack()
ketqua=Text(wd, height =10, width = 40).pack()
wd.mainloop()