Simple calculator with voiced commands.
Based on hiamandeep/tkcalc repository.
Written in python using tkinter
and winsound
standard libraries.
Calculator voices each arithmetic operation, input digit and result of calculations.
It plays separate audio files from voice
folder that correspond to each digit and operation.
-
Download the code
-
Put your own voice
.wav
files undervoice
folder.
1 file per 1 command / digit
e.g.: 0.wav 1.wav, 2.wav, ..., multiply.wav, calculate.wav -
Calculator is voiced with belarusian language.
In order to use it for other language you will also have to change filenames that are used incalculator.py
. -
Launch main script:
python calculator.py
-
eval
is used instead of implementing own Reverse Polish Notation
Yes, you can inject your own malicious code ๐จโ๐ป๐ฑโ๐ป๐ฉโ๐ป -
For simplicity with using
eval
, interger division is implemented instead of calculating percent (% operation) -
Calculation result is shown only after it is voiced. Need to first show the result and voice it afterwards.
-
If result of floating point operation is integer, it is still displayed as float (e.g. 42.0)
-
Layout is small and not beautiful. it was designed to be as simple and as fast to develop as possible :)