This simple app calculator with exception handling will prompt the user to perform one of the four math operations of two numbers repeatedly until they want to exit.
Math operations are:
- Addition
- Subtraction
- Multiplication
- Division
To run the program, you'll need to have Python 3 installed on your computer.
Note: This program might works only for windows os.
I used VS Code to create and run the program.
The script requires the following Python packages:
- PySimpleGUI
pip install pySimpleGUI
- Clone the repository or download the simple_app_calculator.py here.
- Open a terminal and navigate to the directory containing the script:
cd /path/to/directory
- Run the script using python:
python simple_app_calculator.py
- Select from the four math operations
- If user did not select, the math operation error will appear.
- Enter first number and second number.
- If user did not enter or entered an invalid value, the Invalid number error will appear.
- If the user entered 0 as second number as divisor, the zero division error will appear.
- Click 'Submit' button and the result will appear.
- Click 'OK' button and the app will ask if you want to try again.
- If yes, the program will start again.
- If no, the program will say 'Thank You!'. Click Exit to terminate the program.
- The program will run as long as you click 'yes' button and ill terminate if 'no' or exiting the window.