11 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for DragonMastur

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.

Member Avatar for Slass33
0
529
Member Avatar for vegaseat

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 …

Member Avatar for vegaseat
4
2K
Member Avatar for DragonMastur

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 …

0
686
Member Avatar for TrustyTony

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 …

Member Avatar for fonzali
1
2K
Member Avatar for L7Sqr

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 …

Member Avatar for happyuk
2
6K
Member Avatar for ddanbe

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 …

Member Avatar for ddanbe
1
2K
Member Avatar for TrustyTony

Very trivial program which could be thought as conclusion from the Quiz posts (thanks Gribouillis for inspiration for format)

Member Avatar for TrustyTony
0
191
Member Avatar for TrustyTony

This function I did to improve calculator program by eliminating problems with Pythons problem of dividing integer with integer and giving integer division result.

Member Avatar for TrustyTony
0
392
Member Avatar for ddanbe

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
1K
Member Avatar for ddanbe

Here is the second piece of code. The parser tries to interpret the tokens it gets from the scanner.

0
1K
Member Avatar for vegaseat

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
1K

The End.