tkinter Button callback function not being called
You have a few things wrong with your code:
onClick needs the "self" param passed to it and you need to update "command=onClick" to "command=self.onClick"
Your entry1 variable should be set to an instance variable by prepending it with "self" so that it is accessible from the onClick method. Variable scope is a little different in python OOP.
from tkinter import *from tkinter import messageboxfrom tkinter import ttkfrom tkcalendar import DateEntryclass Memo(Frame): def __init__(self,master): Frame.__init__(self,master) self.master=master self.master.title('Memo') self.pack(fill=BOTH, expand=True) frame1=Frame(self,width=500,height=50) frame1.pack(expand=False) label1=Label(frame1,text='Amount',width=10) label1.pack(side=LEFT, padx=10,pady=10) self.entry1=Entry(frame1,width=20) self.entry1.pack(padx=10,fill=X,expand=True) frame2=Frame(self,width=500,height=50) frame2.pack(expand=False) label2=Label(frame2,text='Cartegory',width=10) label2.pack(side=LEFT, padx=10,pady=10) listbox1=Listbox(frame2,width=20) listbox1.insert(END,"식료품비","잡화비","건강관리비","외식비") listbox1.pack(side=LEFT, padx=10,pady=10) frame3=Frame(self,width=500,height=50) frame3.pack(expand=False) label3=Label(frame3,text='Date',width=10) label3.pack(side=LEFT, padx=10,pady=10) dateentry = DateEntry(frame3) dateentry.pack(padx=10,pady=10) frame4=Frame(self,width=500,height=500) frame4.pack(expand=False) button1=Button(frame4,text='csv Export',command=self.okClick) button1.pack(side=LEFT,padx=10,pady=10) def okClick(self): name = self.entry1.get() messagebox.showinfo("이름", name)if __name__ == "__main__": a=Memo(Tk()) a.mainloop()