Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucaspmartins/simple-python-calculator
This repository contains a Simple Python-based calculator application built using the PySide6 library.
https://github.com/lucaspmartins/simple-python-calculator
pyside6 python-3
Last synced: 4 days ago
JSON representation
This repository contains a Simple Python-based calculator application built using the PySide6 library.
- Host: GitHub
- URL: https://github.com/lucaspmartins/simple-python-calculator
- Owner: LucasPMartins
- Created: 2024-11-13T19:28:36.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-29T18:48:22.000Z (26 days ago)
- Last Synced: 2024-12-06T05:07:41.572Z (19 days ago)
- Topics: pyside6, python-3
- Language: Python
- Homepage:
- Size: 47 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Typing SVG](https://readme-typing-svg.herokuapp.com/?font=JetBrains+Mono&color=1e81b0&size=45¢er=true&vCenter=true&width=1000&lines=Simple+Python+Calculator)](https://git.io/typing-svg)
## ❔ About
This repository contains a Simple Python-based calculator application built using the PySide6 library for the graphical user interface. The application features a grid of buttons for input, a display for showing the current input and results, and an info label for additional information.
### Features
- **Basic Arithmetic Operations**: Supports addition, subtraction, multiplication, division, and exponentiation.
- **Error Handling**: Displays error messages for invalid inputs, zero division, and overflow errors.
- **Responsive UI**: Adjusts the size of the window and buttons based on the content.
- **Custom Styling**: Uses `qdarkstyle` for a dark theme and additional custom styles for buttons.### Project Structure
- **main.py**: The entry point of the application. It sets up the main window, display, info label, and buttons grid.
- **main_window.py**: Defines the `MainWindow` class, which is the main container for the application's widgets.
- **display.py**: Defines the `Display` class, a custom `QLineEdit` widget for showing the current input and results.
- **info.py**: Defines the `Info` class, a custom `QLabel` widget for showing additional information.
- **buttons.py**: Defines the `Button` and `ButtonsGrid` classes. `Button` is a custom `QPushButton`, and `ButtonsGrid` manages the layout and functionality of the calculator buttons.
- **utils.py**: Contains utility functions for validating input.
- **styles.py**: Contains the custom styles for the application.
- **variables.py**: Defines constants used throughout the application, such as font sizes and colors.### How to Run
1. **Clone the repository**:
```sh
git clone
cd
```2. **Create a virtual environment**:
```sh
python -m venv venv
```3. **Activate the virtual environment**:
- On Windows:
```sh
venv\Scripts\activate
```
- On macOS/Linux:
```sh
source venv/bin/activate
```4. **Install the dependencies**:
```sh
pip install -r requirements.txt
```5. **Run the application**:
```sh
python main.py
```## 🛠 Tools:
![Visual Studio Code](https://img.shields.io/badge/-Visual%20Studio%20Code-0D1117?style=for-the-badge&logo=visual-studio-code&logoColor=007ACC&labelColor=0D1117)
![Git](https://img.shields.io/badge/-Git-0D1117?style=for-the-badge&logo=git&labelColor=0D1117)
![GitHub](https://img.shields.io/badge/-GitHub-0D1117?style=for-the-badge&logo=github&labelColor=0D1117)
![Windows](https://img.shields.io/badge/-Windows-0D1117?style=for-the-badge&logo=windows&logoColor=0a58ee)
![PySide6](https://img.shields.io/badge/PySide6-0D1117?style=for-the-badge&logo=qt&logoColor=41CD52)## 👨💻 Programming Language
![Python](https://img.shields.io/badge/python-0D1117?style=for-the-badge&logo=python&logoColor=ffdd54)