Tkinter.md

Tkinter

1.创建

import tkinter as tk

  1. 创建toplevel窗口 使用root = tk.Tk()

  2. 创建一个框架 frame = tk.Frame(root)

    框架一般使用于在复杂的布局中起到将组建分组的作用

  3. frame.pack()

  4. 创建组件 例:button

    button = tk.Button(frame, text="dsa", fg="", command=func_address)

  5. 添加组件 button.pack(side=tk.LEFT)

  6. 启动主事件循环 root.mainloop()

原文地址:https://www.cnblogs.com/nsfoxer/p/14353887.html