Skip to content

Conversation

Copy link

Copilot AI commented Sep 8, 2025

This PR adds a simple calculator application implemented in Python using Tkinter. The app provides a graphical interface with:

  • A display area for current input and results
  • Buttons for digits (0–9)
  • Buttons for basic operations (+, -, ×, ÷)
  • A clear button (C)
  • An equals button (=)

Keyboard input is supported for digits and operators, and pressing Enter evaluates the current expression. The × and ÷ symbols in the UI are converted to * and / for evaluation under the hood. Expression evaluation uses Python’s eval with restricted builtins.

For CI and non-interactive environments, the application supports an optional screenshot mode that renders the UI and saves it to calculator_screenshot.png:

# Run interactively
python3 calculator.py

# Generate a screenshot (no persistent window)
python3 calculator.py --screenshot
# or
CALC_SCREENSHOT=1 python3 calculator.py

The README has been updated with basic usage instructions, and a generated screenshot (calculator_screenshot.png) is included in the repository for visual verification.

Fixes #2.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Author

Copilot AI commented Sep 8, 2025

@josephyu-97 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 3 commits September 8, 2025 02:27
Co-authored-by: josephyu-97 <223607485+josephyu-97@users.noreply.github.com>
Co-authored-by: josephyu-97 <223607485+josephyu-97@users.noreply.github.com>
Co-authored-by: josephyu-97 <223607485+josephyu-97@users.noreply.github.com>
Copilot AI changed the title [WIP] create a python calculator app Add standalone Tkinter calculator app with optional headless screenshot Sep 8, 2025
Copilot AI requested a review from josephyu-97 September 8, 2025 02:31
Copilot finished work on behalf of josephyu-97 September 8, 2025 02:31
@josephyu-97 josephyu-97 marked this pull request as ready for review September 8, 2025 02:36
@josephyu-97 josephyu-97 merged commit c9d7887 into main Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create a python calculator app

2 participants