Reusable Code Snippet Calculator 4 Years Ago 4 Years Ago It could be simplifide more, I know. I was doing it as an exersise so its rough and skecthy. But it's workable, I tested it more then 50 times. 0 44 Reusable Code Snippet Updated Tiny Tkinter Calculator (Python) 6 Years Ago 4 Years Ago This is the updated version of the Tiny Tkinter Calculator. It has more power, since you can type in functions contained in the Python math module then press the equals key. You can then move the result into memory for other calculations. The code is written in OOP class style as an exercise, still simple and hopefully very readable. Again, you are welcome to improve the functionality, but don't turn it into a HUGE calculator. 4 71 Reusable Code Snippet Calculator with tkinter 4 Years Ago I needed a calculator and I didn't want to use google since my internet is slow. So I made one! Here it is. Working with it is simple. Use the number and operation keys("c" for clear, "p" for pi, and "s" for sqrt) as well as the return and enter key, for equals, or just use the button gui! Hope you like it! The only thing I would really like to work on is the gui. If some one would help me on that that would be greatly appreciated. I will be adding more operations, fixing the power button, and … 0 14 Reusable Code Snippet Simple calculator 9 Years Ago 6 Years Ago Here little debugged version of my calculator posted earlier in GUI calculator thread. I prepared it after listening that their teacher did more limited calculator in around 150 lines of code with their graphics module. This is 115 lines without empty lines and comment lines [CODE]>>> li=[i for i in open('SimplistiCalc.pyw') ... if i.strip() and not i.strip().startswith('#')] >>> len(li) 115 >>>[/CODE] Save attached gifs to same directory as the code. Comments welcome! 1 36 Reusable Code Snippet Calculator using shunting-yard algorithm 7 Years Ago 6 Years Ago Hello. This code snippet is a basic calculator. The general concept is that the calculator accepts infix expressions as strings, converts them to reverse polish notation by way of the shunting-yard algorithm and then evaluates the resulting expression. I tried to encapsulate the functionality of each piece so that, in theory, they could be pulled out and used independently. The shunting-yard behavior is provided via `class ShuntingYard`; I used the visitor pattern for the `Token`; and `RPNExpression` could be built by hand (or some other process) and still be used with `Calculator`. I removed almost all error checking and input … 2 83 Reusable Code Snippet Console calculator Part 1 : The Scanner 11 Years Ago 8 Years Ago This is a series of 3 code snippets which together form a completly working "calculator". I used a console application in VS C# 2008, but 2005 should cause no problems. To start with : here you have the code for a scanner class. A scanner reads the inputline and tries to get some meaningfull words(sometimes called tokens) from it. It then passes that information to a parser. 1 43 Reusable Code Snippet Binary calculations 8 Years Ago 8 Years Ago Very trivial program which could be thought as conclusion from the Quiz posts (thanks Gribouillis for inspiration for format) 0 4 Reusable Code Snippet 1/3=0 eliminator 9 Years Ago 9 Years Ago This function I did to improve calculator program by eliminating problems with Pythons problem of dividing integer with integer and giving integer division result. 0 8 Reusable Code Snippet Console calculator Part 3 : The calculator engine 11 Years Ago This is the last part. This is the code that sets it al together and lets the parser and scanner do some work. Happy calculating! 0 14 Reusable Code Snippet Console calculator Part 2 : The Parser 11 Years Ago Here is the second piece of code. The parser tries to interpret the tokens it gets from the scanner. 0 8 Reusable Code Snippet Mortgage Calculator (Python) 13 Years Ago Just a small Python program to calculate monthly payments and other costs. I have compared it with some of the calculators available from many of the online mortgage companies, and results seem to match. 2 5

The End.