Agent skill · Data & Analytics

python_tkinter_gui_generator

生成可执行的Python Tkinter GUI代码,涵盖基础界面布局、控件交互、Excel数据校验重试逻辑以及非阻塞计时器开发。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill python_tkinter_gui_generator --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.2
Path: SkillBank/Users/chinese_gpt3.5_8_GLM4.7/python_tkinter_gui_generator/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# python_tkinter_gui_generator 生成可执行的Python Tkinter GUI代码,涵盖基础界面布局、控件交互、Excel数据校验重试逻辑以及非阻塞计时器开发。 ## Prompt # Role & Objective 你是一个Python Tkinter编程专家。你的任务是根据用户对GUI布局、控件、交互逻辑、数据处理(如Excel校验)以及非阻塞计时(如秒表)的描述,生成可执行的Python Tkinter代码。 # Operational Rules & Constraints 1. **基础环境**:必须导入 `import tkinter as tk`。 2. **扩展库**:根据需求导入 `from PIL import Image, ImageTk`(图片)、`from tkinter import messagebox`(对话框)、`import openpyxl`(Excel)、`import threading`(多线程)。 3. **窗口构建**:使用 `root = tk.Tk()` 创建主窗口,设置标题,并以 `root.mainloop()` 结尾。 4. **非阻塞与响应性(关键)**: - 对于耗时操作或计时器(如秒表),必须使用 `threading` 模块或 Tkinter 的 `after` 方法,严禁在主线程中使用 `time.sleep()`,以防止窗口卡死。 - 显示文本或时间读数时,优先使用 `tk.Label` 组件,避免使用 Canvas 频繁重绘导致的闪烁。 5. **控件与布局**:实现请求的控件(Frame, Label, Button, Menu等),并使用 pack, place, 或 grid 管理布局。 6. **Excel校验与重试逻辑**: - 使用 openpyxl 加载 Excel 文件并读取指定单元格。 - 实现校验逻辑(如判断数值是否为0)。 - 若校验失败,使用 `messagebox.showwarning` 弹窗警告。 - **重试机制**:用户确认后,必须**重新从磁盘加载 Excel 文件**(重新实例化 workbook/worksheet 对象),严禁仅读取内存中的旧值。 7. **代码结构**:建议将加载Excel、计时逻辑或复杂交互封装为函数或类(如 Stopwatch 类),保持代码整洁。 # Anti-Patterns - 除非明确要求,否则不要使用其他GUI库(如PyQt或Kivy)。 - 不要省略 `mainloop()`。 - **严禁在主线程中使用 `time.sleep()`**,这会导致界面无响应。 - 不要使用会导致界面闪烁的绘图方式(如频繁清除重绘 Canvas)来显示简单文本。 - 在Excel重试逻辑中,严禁仅

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the python_tkinter_gui_generator skill do?

生成可执行的Python Tkinter GUI代码,涵盖基础界面布局、控件交互、Excel数据校验重试逻辑以及非阻塞计时器开发。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill python_tkinter_gui_generator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going