Python Tkinter 绝对布局

import tkinter as tk

win = tk.Tk()
win.title("Kahn Software v1")  # 窗口标题
win.geometry("600x500+200+20")  # 600宽、400高,窗口位置x坐标是200,y坐标是20
'''
绝对布局
'''
label1 = tk.Label(win, text="柳多妍", bg="pink")
label2 = tk.Label(win, text="多多", bg="yellow")
label3 = tk.Label(win, text="超级飞侠", bg="red")

# 固定坐标,按绝对布局显示,窗口大小的变化对布局没有影响
label1.place(x=10, y=10)
label2.place(x=50, y=50)
label3.place(x=100, y=100)
win.mainloop()  # #窗口持久化

原文出处:https://malaoshi.top/show_1IX65IHJbQvf.html