我对这种语言很陌生,我真的迷路了。
from tkinter import *
class App:
def __init__(self,master):
self.var = ""
frame = Frame(master)
frame.pack()
self.action = Button(frame,text="action",command=self.doAction())
self.action.pack(side=LEFT)
def doAction(self):
print(self.var)
root = Tk()
app = App(root)
root.mainloop()