为了账号安全,请及时绑定邮箱和手机立即绑定

Tkinter 标签不会出现在框架内

Tkinter 标签不会出现在框架内

小唯快跑啊 2024-01-24 16:19:05
import res = "Product desingATK 30Trace back. TheATK 30 is a nice device. "keywords = ['ATK 30', 'PPK 50', 'HJF12 10']pattern = fr'\s*({"|".join(sorted(map(re.escape, keywords),key=len,reverse=True))})\s*'print(pattern)                       # => \s*(HJF12\ 10|ATK\ 30|PPK\ 50)\s*print(re.sub(pattern, r' \1 ', s))  # => Product desing ATK 30 Trace back. The ATK 30 is a nice device. 
查看完整描述

1 回答

?
蛊毒传说

TA贡献1895条经验 获得超3个赞

初始化后修复网格小框架的小问题


from tkinter import *


root = Tk()

root.geometry('700x500')


# Big Frame

big_frame = LabelFrame(root, text='Big Frame', width=350, height=450, padx=5, pady=5)

big_frame.grid(row=0, column=0, padx=(1, 0), sticky='nsew')  # the sticky prevents the label from being inside the frame


root.rowconfigure(0, weight=1)

root.columnconfigure(0, weight=1)


# Small Frame

small_frame = LabelFrame(big_frame, text='Small Frame', width=120, height=200)

small_frame.grid(row=0, column=0)


label = Label(small_frame, text='Label')

label.grid(row=0, sticky='nw')



mainloop()


查看完整回答
反对 回复 2024-01-24
  • 1 回答
  • 0 关注
  • 92 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信