Academic project · CASE STUDY

Calculadora Python

Tkinter desktop calculator with a web version and arithmetic rule tests.

The challenge

Practice logic, input validation and interfaces.

The solution

Arithmetic operations, memory, error handling and history in the web version.

Main features

  • Basic operations, percentages, sign switching and error handling.
  • Memory, history of up to 20 calculations and keyboard support in the web version.
  • Preservation of the original academic Tkinter desktop version.

Architecture

Python and Tkinter in the original version, HTML, CSS and JavaScript on the web.

  1. Python / Tkinter
  2. Calculation logic
  3. JavaScript / Web

Technical decisions and limitations

Both versions share chained-operation logic but use different precision formats.

Project status

Public source code.

Availability

Source code
Public
Demo
Available
Case study
Available
Status
Completed

Context and problem

One of the first projects of the degree: a desktop calculator in Python with Tkinter. In 2026 it gained a web version using the same logic.

How it works

  1. Input (keyboard or buttons)
  2. Chained evaluation
  3. Result or explicit error
  4. History and memory

Business rules

  • Chained evaluation when the operator changes.
  • Division by zero is an explicit error, and the comma is the decimal separator.
  • Memory M+, M−, MR and MC, and a history of recent calculations.
  • The Python version shows up to ten decimal places and the web version up to twelve significant digits, by product decision.

Technical challenges and solutions

  • Challenge: Keeping the original behavior on the web. Solution: The web version preserves the original semantics and the same key map.

Security and privacy

  • Runs in the browser, with no backend and no data collection.

Tests and evidence

  • Tests with node --test (tests/calculator.test.mjs).

Lessons learned

  • Keeping the original beside its evolution shows what changed and what did not.

Current status

Academic project preserved and evolved. Public code, with the desktop version and the web version, which, as documented in the repository, is on Firebase Hosting.

Documented evidence

The README records 36 automated web tests, including division by zero, memory and history.

Existing documented interface.