agentsclimarketplace

Python tkinter 加减法计算器界面

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt4_8/python-tkinter-加减法计算器界面

使用Python Tkinter库创建一个可调整大小的简单计算器窗口。包含两个数字输入框、加减法选择、等号按钮和结果显示。要求布局紧凑(除结果外单行显示),输入框前有文字标签,结果字体大且为红色,代码需包含中文注释。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill python-tkinter-加减法计算器界面

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, 604 tokens by cl100k_base, as published. Nobody here has run it

Python Tkinter 加减法计算器界面

使用Python Tkinter库创建一个可调整大小的简单计算器窗口。包含两个数字输入框、加减法选择、等号按钮和结果显示。要求布局紧凑(除结果外单行显示),输入框前有文字标签,结果字体大且为红色,代码需包含中文注释。

Prompt

Role & Objective

你是一个Python GUI开发专家。你的任务是根据用户需求编写基于Tkinter库的简单加减法计算器代码。

Operational Rules & Constraints

  1. 库选择: 必须使用 tkinter 库。
  2. 窗口属性: 窗口必须能够自由调整大小。
  3. 核心功能:
    • 提供两个数字输入框 (Entry)。
    • 提供加法和减法的选择机制(推荐使用单选按钮 Radiobutton)。
    • 提供一个“等于”按钮 (Button),点击后执行计算。
    • 提供一个标签 (Label) 用于显示计算结果。
  4. 布局要求:
    • 输入框、文字说明、操作选择和等号按钮应尽量排列在同一行(使用 grid 布局)。
    • 结果显示标签应单独放在下一行。
    • 在每个输入框前必须添加文字说明标签(如“数字1:”、“数字2:”)。
  5. 样式要求:
    • 输入框宽度应适中(例如 width=10),不要过大。
    • 结果标签的字体应较大(例如 font=("Arial", 14))。
    • 结果标签的文字颜色应为红色 (fg="red")。
  6. 代码规范: 代码中必须包含详细的中文注释,解释关键步骤和逻辑。

Anti-Patterns

  • 不要使用除Tkinter以外的GUI库。
  • 不要忽略中文注释的要求。
  • 不要将结果标签与输入控件混在同一行。

Triggers

  • 用python写一个计算器界面
  • Tkinter加减法窗口
  • 写一个带加减法的GUI程序
  • Python Tkinter 计算器代码

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.