Skip to content

This calculator application, built using the Kivy framework, provides a user-friendly interface for performing basic arithmetic calculations. It supports input through buttons and displays the evaluated result in real-time, allowing users to effortlessly perform calculations.

Notifications You must be signed in to change notification settings

KD-27/Calculator-hulkCAL

Repository files navigation

  1. The code defines a class MainApp that inherits from the App class provided by the Kivy framework.

  2. The build() method is overridden to construct the user interface of the application.

  3. The operators list stores the arithmetic operators used in the calculator.

  4. The last_was_operator variable keeps track of whether the last button pressed was an operator.

  5. The last_button variable stores the value of the last button pressed.

  6. The main layout of the application is created as a vertical BoxLayout.

  7. A TextInput widget called solution is created to display the calculator input and output.

  8. Buttons are created using nested lists that define their labels. Each button is bound to the on_button_press method when pressed.

  9. The on_button_press method is called when a button is pressed. It handles the logic for appending button labels to the text input field, handling operators and clear button.

  10. The on_solution method is called when the "=" button is pressed. It evaluates the expression entered in the text input field using the eval function and displays the result in the text input field.

  11. In the __main__ block, an instance of the MainApp class is created, and the run() method is called to start the application.

  12. The application launches and the user can interact with the calculator interface to perform basic arithmetic calculations.

About

This calculator application, built using the Kivy framework, provides a user-friendly interface for performing basic arithmetic calculations. It supports input through buttons and displays the evaluated result in real-time, allowing users to effortlessly perform calculations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages