摘要: python在用tk编程时, 界面响应函数最好在另外一个线程中运行, 以免界面没有响应. 为方便使用, 封装了一个装饰器, 调用函数时自动在另外一个线程中运行. 示例代码如下: ```python import threading def run_in_thread(func): def wrapp 阅读全文
posted @ 2023-07-18 17:41 顺其自然,道法自然 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 传递一组无线按钮名称的列表, 返回用户选择的是哪个选项: ```python import tkinter as tk import threading from tkinter import Menu, Frame, Label class RatioButtons(tk.Frame): '''对 阅读全文
posted @ 2023-07-18 10:38 顺其自然,道法自然 阅读(24) 评论(0) 推荐(0) 编辑