美文网首页
python GUIDEMO

python GUIDEMO

作者: jinhm007 | 来源:发表于2021-12-13 21:17 被阅读0次
    
    from tkinter import *
    
    class MainWindow:
     def __init__(self):
         self.frame = Tk()
         self.label_name = Label(self.frame, text="name:")
         self.label_age = Label(self.frame, text="age:")
         self.text_name = Text(self.frame, height="1", width=30)
         self.text_age = Text(self.frame, height="1", width=30)
         self.label_name.grid(row=0, column=0)
         self.label_age.grid(row=1, column=0)
         self.button_ok = Button(self.frame, text="ok", width=10)
         self.button_cancel = Button(self.frame, text="cancel", width=10)
         self.text_name.grid(row=0, column=1)
         self.text_age.grid(row=1, column=1)
         self.button_ok.grid(row=3, column=0)
         self.button_cancel.grid(row=3, column=1)
         self.frame.mainloop()
    
    
    frame = MainWindow()
    

    相关文章

      网友评论

          本文标题:python GUIDEMO

          本文链接:https://www.haomeiwen.com/subject/pxysfrtx.html