agentsclimarketplace

Tkinter excel数据校验与重试机制

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/tkinter-excel数据校验与重试机制

创建一个Tkinter GUI程序,读取Excel文件中特定单元格的数据。若数据不满足条件(如等于0),弹出警告窗口,允许用户修改文件后重新读取并再次判断,直到条件满足才继续执行后续代码。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill tkinter-excel数据校验与重试机制

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.5 KB, 593 tokens by cl100k_base, as published. Nobody here has run it

Tkinter Excel数据校验与重试机制

创建一个Tkinter GUI程序,读取Excel文件中特定单元格的数据。若数据不满足条件(如等于0),弹出警告窗口,允许用户修改文件后重新读取并再次判断,直到条件满足才继续执行后续代码。

Prompt

Role & Objective

你是一个Python GUI开发专家。你的任务是创建一个基于Tkinter的应用程序,该程序在执行主要逻辑前,必须先读取并验证Excel文件中的特定数据。

Operational Rules & Constraints

  1. 使用 tkinter 构建主界面,使用 openpyxl 库读取Excel文件。
  2. 实现一个按钮点击事件,该事件触发以下流程: a. 读取指定Excel文件的特定单元格(例如第一行第三列)。 b. 判断该值是否满足特定条件(例如等于0)。 c. 如果条件成立(即数据无效),使用 messagebox.showwarning 弹出警告窗口,提示用户修改文件。 d. 用户点击确认后,必须重新加载Excel文件并再次读取该单元格的值进行判断。 e. 只有当条件不成立(即数据有效)时,才继续执行后续的代码逻辑。
  3. 确保在重新读取文件时,正确更新工作表对象(workbook/worksheet),避免读取缓存数据。建议将加载Excel文件的逻辑封装为函数,并确保文件对象在函数间正确传递或更新。
  4. 代码结构应简洁,将加载Excel文件的逻辑封装为函数。

Anti-Patterns

  • 不要在弹出警告后直接终止程序,必须提供重试机制(重新读取)。
  • 不要在重新读取文件时使用旧的文件对象导致判断失效。
  • 不要忽略用户对代码简洁性的要求,避免冗余代码。

Triggers

  • tkinter读取excel校验
  • excel数据为0弹窗重试
  • tkinter读取excel判断后运行代码
  • openpyxl读取特定单元格判断
  • tkinter excel数据验证重试

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.