tkinter之pick布局

简介: tkinter之pick布局
from tkinter import *

win = Tk()
win.title("逻辑网")
win.geometry('450x300+300+300')
win.iconbitmap('../image/icon.ico')
lb_red = Label(win, text="红色", bg="Red", fg='#ffffff', relief=GROOVE)
# 默认以top方式放置
lb_red.pack()
lb_blue = Label(win, text="蓝色", bg="blue", fg='#ffffff', relief=GROOVE)
# 沿着水平方向填充,使用 pady 控制蓝色标签与其他标签的上下距离为 5 个像素
lb_blue.pack(fill=X, pady='5px')
lb_green = Label(win, text="绿色", bg="green", fg='#ffffff', relief=RAISED)
# 将 黄色标签所在区域都填充为黄色,当使用 fill 参数时,必须设置 expand = 1,否则不能生效
lb_green.pack(side=LEFT, expand=1, fill=BOTH)
win.mainloop()
相关实践学习
部署高可用架构
本场景主要介绍如何使用云服务器ECS、负载均衡SLB、云数据库RDS和数据传输服务产品来部署多可用区高可用架构。
负载均衡入门与产品使用指南
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务,可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。 本课程主要介绍负载均衡的相关技术以及阿里云负载均衡产品的使用方法。
目录
相关文章
|
13天前
|
XML Java Android开发
16. 【Android教程】选择框 RadioButton/Check
16. 【Android教程】选择框 RadioButton/Check
14 3
|
1月前
|
Java Android开发 Kotlin
Android Dialog 弹出时,隐藏 navigation bar
Android Dialog 弹出时,隐藏 navigation bar
24 1
|
1月前
|
Shell Python
Tkinter:功能按钮Button
Tkinter:功能按钮Button
|
1月前
|
Python
tkinter之place
tkinter之place
31 0
|
1月前
|
Python
tkinter之下拉菜单
tkinter之下拉菜单
58 1
|
1月前
|
Python
tkinter之button添加背景图片
tkinter之button添加背景图片
66 1
|
Python Windows 容器
Python Tkinter教程(二)——Label控件、Frame控件、Button控件的完整参数和所有方法及详细用法
Python Tkinter教程(二)——Label控件、Frame控件、Button控件的完整参数和所有方法及详细用法
153 0
|
Python
Tkinter的Checkbutton控件
Tkinter的Checkbutton是一个有着许多选项的控件,可以一次选择几个选项
54 0
Tkinter的Checkbutton控件
|
Python
Tkinter的Radiobutton控件
Tkinter的Radiobutton是一个含有多个选项的控件,但是只能选择其中的一个选项
81 0
Tkinter的Radiobutton控件
|
Python
【tkinter学习笔记 - 5】:布局管理器(grid、pack、place)
【tkinter学习笔记 - 5】:布局管理器(grid、pack、place)
174 0
【tkinter学习笔记 - 5】:布局管理器(grid、pack、place)