zoukankan      html  css  js  c++  java
  • Thiker ——制作界面

    参考的链接:

    https://www.cnblogs.com/xy-ju24/p/9212855.html

    https://www.bilibili.com/video/BV1jW411Y7dL?p=3

    练习

    1.初步

    import tkinter as tk
    
    window = tk.Tk()
    window.title("学生信息管理系统")
    window.geometry("500x500")
    
    var = tk.StringVar()
    l = tk.Label(window, textvariable=var, bg="blue", font=('Arial',12), width=15, height=2)
    # 放置,
    # 放置点:l.place() l.pack() on_hit = False def hit_me(): global on_hit if not on_hit: on_hit = True var.set('Sno') else: on_hit = False var.set("学号") b = tk.Button(window, text="Sno", width=15, height=2, command=hit_me)
    # hit_me 是命令具体内容 b.pack() # while 点一下就会更新数据 window.mainloop()

     2.Entry

    import tkinter as tk
    
    window = tk.Tk()
    window.title("学生信息管理系统")
    window.geometry("500x500")
    
    
    e = tk.Entry(window, show=None)  # show="*",不显示
    e.pack()
    
    
    def insert_point():
        var = e.get()
        t.insert('insert', var)
    
    
    def insert_end():
        var = e.get()
        t.insert(1.1, var)
    
    
    b1 = tk.Button(window, text="insert_point", width=15, height=2, command=insert_point)
    b1.pack()
    b2 = tk.Button(window, text="insert_end", width=15, height=2, command=insert_end)
    b2.pack()
    
    t = tk.Text(window, height=2)
    t.pack()
    
    
    # while 点一下就会更新数据
    window.mainloop()
  • 相关阅读:
    12.27 cf div3 解题报告
    网络流24题 P2754 [CTSC1999]家园
    P3690 【模板】Link Cut Tree (动态树)
    P2147 [SDOI2008]洞穴勘测
    P3203 [HNOI2010]弹飞绵羊
    P4172 [WC2006]水管局长
    P3979 遥远的国度
    P3128 [USACO15DEC]最大流Max Flow
    P3178 [HAOI2015]树上操作
    [SDOI2014]旅行
  • 原文地址:https://www.cnblogs.com/kekefu/p/12889635.html
Copyright © 2011-2022 走看看