The tkinter package (“Tk interface”) 是一个基于Tcl/Tk GUI工具标准的Python接口。集合在大多数操作系统都有Tk和tkinter 库,包括MacOS,Window还有一些Unix类的操作系统
【基础操作】
1 设置窗口
# -*- coding: utf-8 -*-
from tkinter import *
#创建主窗口
top = Tk()
top.title("超声日志可视化工具") #标题设置
top.geometry('300x100') #设置窗口大小为300x100 横纵尺寸
#调用主事件循环,让窗口程序保持运行。
top.mainloop()
2 添加按钮组件
# -*- coding: utf-8 -*-