https://github.com/sebe324/pythoncalculator
A calculator made in PySimpleGui with C++ bindings
https://github.com/sebe324/pythoncalculator
calculator contributions-welcome cpp good-first-issue pybind11 pysimplegui python rpn-calculator
Last synced: about 2 months ago
JSON representation
A calculator made in PySimpleGui with C++ bindings
- Host: GitHub
- URL: https://github.com/sebe324/pythoncalculator
- Owner: sebe324
- License: mit
- Created: 2023-08-14T09:20:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-08T18:52:46.000Z (3 months ago)
- Last Synced: 2025-03-27T14:52:29.354Z (2 months ago)
- Topics: calculator, contributions-welcome, cpp, good-first-issue, pybind11, pysimplegui, python, rpn-calculator
- Language: Python
- Homepage:
- Size: 769 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Calculator
A calculator made in python.This application uses the Reverse Polish Notation for calculations.
The algorithm is written in C++, but the user interface is made in PySimpleGui.
## Calculator in action
## Tests
## Contributing
- If anyone wants to contribute feel free to do so. Just send a pull request and I will review it.
- You can check out the issues or the to-do list at the bottom of this readme.
## How to build### 1. Just building the python code
- Install python
- Install PySimpleGUI
```pip install PySimpleGUI```
- Install playsound
```pip install playsound```
- Make sure that the .pyd file and the .py file are in the same folder
- Just do this line in the same directory as the files.
```python CalculatorUI.py```
- It should work.### 2. Building the c++ code and using pybind11
#### CMake
- Make sure you have cmake and pybind11 installed.
- Go to the c++ folder. In the project directory do: ```cd src/c++```
- Sometimes CMake can have problems with finding pybind11. To fix this try this:
- In console ```pip show pybind11```.
- In CMakeLists.txt change [LOCATION] to the location you get from the command.
- If your path contains single escape characters ```\``` make sure to replace them with ```\\```
- ```cmake .```
- ```cmake --build .```
- The .pyd file should be located in one of the folders created.
- Now you can move the .pyd file to the python src folder and build the rest.
#### Visual Studio
- This process is quite complicated and I myself had a lot of problems with using pybind.
- I'm going to leave this [guide](https://learn.microsoft.com/en-us/visualstudio/python/working-with-c-cpp-python-in-visual-studio?view=vs-2022). It does a
much better job explaining this than I could.
## To do list
- Write the rpn algorithm in C++ [x]
- Write tests to make sure things are running smoothly [x]
- Organize rpn code to be more readable [x]
- Bind the C++ code to python [x]
- Create a GUI [x]
- Add functionality to the GUI [x]
- Fix all the bugs [ ]
- Add documentation [ ]
- Light and dark mode [ ]
- Window confirming if the user wants to exit the calculator [x]