Python学习笔记-简单GUI开发
#filename:tkinter_1.pyfrom tkinter import *
class App:
def __init__(self,master):
frame = Frame(master)
frame.pack()
self.hello = Button(frame, text="hello",
command=self.hello)
self.hello.pack(side=LEFT)
self.quit = Button(frame, text="Quit", fg="red",
command=frame.quit)
self.quit.pack(side=RIGHT)
def hello(self):
print("Hello,world!")
root = Tk()
root.wm_title("hello")
root.wm_minsize(200,200)
app = App(root)
root.mainloop()
页:
[1]