• 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()
  • 相关阅读:
    Java IO流 简介
    Centos8安装java部署环境
    RedisTemplate
    手把手教windows上安装linux虚拟机及环境配置
    使用Swagger2构建 RESTful API文档
    VMware 安装 Centos 7 虚拟机配置网络
    别再写满屏的 try catch 了
    isEmpty 和 isBlank 的用法区别
    SpringBoot 中必须掌握的45个注解
    数组的栈方法
  • 原文地址:https://www.cnblogs.com/kekefu/p/12889635.html
Copyright © 2020-2023  润新知