pack grid place 放置位置

import tkinter as tk

window = tk.Tk()
window.title("daxiangcai's title")
window.geometry('800x400')
# 注意以下几种不能同时使用 tk.Label(window, text
='side').pack(side='top') # top/bottom/left/right tk.Label(window, text='place').place(x=10, y=100, anchor='nw') # 将图片的左上角放在(10,100)处;中间的参数为center for i in range(4): for j in range(3): tk.Label(window, text='grid').grid(row=i, column=j, padx=10, pady=10) window.mainloop()

 

posted @ 2022-07-05 23:15  树叶本子  阅读(24)  评论(0)    收藏  举报