Tkinter 标签不会出现在框架内

import re

s = "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. 


小唯快跑啊
浏览 40回答 1
1回答

蛊毒传说

初始化后修复网格小框架的小问题from tkinter import *root = Tk()root.geometry('700x500')# Big Framebig_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 frameroot.rowconfigure(0, weight=1)root.columnconfigure(0, weight=1)# Small Framesmall_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()
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python