Simple Calculator GUI using PySimpleGUI
This repository contains a Python script that implements a basic calculator graphical user interface (GUI) using the PySimpleGUI library. The calculator GUI allows users to perform simple arithmetic calculations through a user-friendly interface.
Features
User-friendly graphical interface for performing arithmetic calculations.
Buttons for digits (0-9), decimal point, basic arithmetic operators (+, -, *, /), and control actions (Clear, Enter).
Option to change the visual theme of the calculator interface.
Real-time display of entered numbers and calculation results.
Prerequisites
Python 3.x
PySimpleGUI library (pip install PySimpleGUI)
How to Run
Make sure you have Python 3.x installed on your system.
Install the PySimpleGUI library using the following command:
Copy code
pip install PySimpleGUI
Clone this repository or download the provided calculator.py script.
Open a terminal or command prompt and navigate to the directory containing calculator.py.
Run the script using the following command:
Copy code
python calculator.py
Usage
Upon running the script, a calculator GUI window will appear.
Use the buttons to input digits (0-9), decimal point, and perform basic arithmetic operations.
The "Clear" button resets the calculator's current input and operation.
The "Enter" button evaluates the entered mathematical expression and displays the result.
The "Theme" menu at the top of the window allows you to change the visual theme of the GUI.
Themes
The calculator GUI supports the following themes:
LightGrey1 (default)
BlueMono
Grey8
Random
To change the theme, click on the "Theme" menu and select the desired theme from the dropdown.
Note
The code uses the eval function for expression evaluation, which can be a security risk in some scenarios. It's recommended to use safer alternatives for expression evaluation in production applications.
Contributions
Contributions to this project are welcome! If you find any issues or have ideas for improvements, feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for more details.