Essay Undergraduate 449 words

Python program fundamentals and applications

Last reviewed: June 18, 2011 ~3 min read

Python Programming

Tkinter is a standard python interface to the TK GUI toolkit .Tinker is combined of number of modules. The TK interface is located in a binary module named _tkinter, this module contains a low level interface to TK .Assignment contain a simple form application created from tkinter widget. Application is used to perform four simple arithmetic operations that are addition, subtraction, multiplication and division.

COMPONENTS OF APPLICATION:

It is a simple application titled as "my application" with minimum number of components. It has one form displaying two text boxes to get input, four buttons to perform functionality and a label to display output.

VISUAL DISPLAY:

Form used in application contains a grid .First two rows of grid consists of text boxes. Both text boxes are expanded to a column span of "2." Next grid holds four buttons labeled as "Add," "Subtract," "Multiply" and "Divide."Buttons are displayed in way that "Add" and "Subtract" buttons are in same row with consecutive columns while "Multiply" and "Divide" are displayed in next row. Row number four contains a label with properties of white text on blue background. Text of label is set to be left aligned. Grid is horizontally resizable but resized property in vertical position is prevented.

FUNCTIONALITY:

Form contains two string values. Whenever any of four buttons is clicked, specific functionality of that button will be performed on given values. The result of function will be displayed in the label. Value of label is displayed as "0" by default, after each function control will automatically go to first text box to rewrite the text values.

HOW INTERFACE WILL BE DISPLAYED:

This process involves following steps:

Import GUI class named as tkinter

A class named as "simpleapp" is being inherited from tkinter.

Call constructor of inherited class

Save reference of inherited class to parents widget

Create a grid

Initially a value of "0" will be assigned to "FirstNumberVar" and "SecondNumberVar."

Displaying string values in first two rows of first column.

Add four buttons to grid labeled with their functionality used to be perform.

Add a label to grid displaying initial value of "0."

FUNCTIONS USED:

This program has following main functions:

OnAdd:

Perform addition on input values and display result in label

You’re 82% through this paper. Sign up to read the full paper.

Sign Up Now — Instant Access Already a member? Log in
130,000+ paper examples AI writing assistant Citation generator Cancel anytime
Cite This Paper
PaperDue. (2011). Python program fundamentals and applications. PaperDue. https://www.paperdue.com/essay/python-program-118396

Always verify citation format against your institution’s current style guide requirements.