Training 1
Training 1
Training 1
Submitted By:
ABHINAV SINGH
(2007753)
ACKNOWLEDGEMENT
It is our pleasure to be indebted to various people, who directly or indirectly contributed in the
development of our project and who influenced our thinking, behaviour and acts during the course of
study.
I express our sincere gratitude to our HOD (CSE Department) and all teachers for providing us an
opportunity to work on this project and helps us to complete our work on time.
I am thankful to Mr. SUNIL SHARMA, my Project Mentor for their support, cooperation, and
motivation provided to us during the development of project for constant inspiration, presence and
blessings. Moreover, they provided their valuable suggestions and precious time in accomplishing our
project report.
Lastly, I would like to thank the Almighty and my Parents for their moral support and my friends
with whom I shared my day-to-day experience and received lots of suggestions that improved my
quality of work.
With Regards
Abhinav Singh
INDEX
CHAPTER 1-INTRODUCTION
1 4
TO THE PROJECT
CHAPTER-2 OBJECTIVES
2 5
CHAPTER-5 CONCLUSION
5 10-11
C HAPTER 1 – INTRODUCTION TO THE PROJECT
The Number Guessing Game project in python is based on python and python tkinter.
When the user runs the program, our code will generate a random number between 0–10. The
user will be unaware of the randomly generated number. Now the user has to guess the value of
the randomly generated number. The user enters the value in the entry box.
After that, the user will press the check button. The button will trigger a function. The function
will check whether the number entered by user matches the randomly generated number. If the
guessed number is correct, then the program will display the CORRECT label and the actual
number (which, in this case, will be same as guessed number).
Now, if the guessed number is less than the randomly generated number, then our program will
show the TOO LOW label, and this will also clear the entry box, so that the user can enter a new
number.
If the guessed number is higher than the actual number, then our program will show the TOO
HIGH label and clear the entry box. This way the user can continue guessing the correct
number.
If the label shows TOO HIGH, then the user is supposed to enter a lower number than they
guessed. If the label shows TOO LOW, then the user is supposed to enter a higher number than
they guessed the first time.
Our program will also count the number of attempts it took the user to guess the correct number.
It will show the total attempts when the user finally make the correct guess.
If the user wants to play a new game, they have to press the main close button. If the user presses
the CLOSE button in our application then they will exit the game completely.
Given an integer N. A number guessing game is a simple guessing game where a user is supposed
to guess a number between 0 and N in a maximum of 10 attempts. The game will end after 5
attempts and if the player failed to guess the number, and then he loses the game
Random number can be generated using python random module. Since we want to generate only
integer number so we will use randint() method of random module.
Python random.randint()method accepts starting and end numbers. Then it generates any
number between this range.
Number guessing game that told you if the number you put in was too high or too low
and then congratulated you when the number was correct
SOFTWARE REQUIREMENTS: -
HARDWARE REQUIREMENTS: -
Windows: - 7 above
Internet: - Internet connection required for software activation.
Hard Drive: - Minimum 32GB; Recommended 64GB or more.
Processor: - Minimum 1 GHz; Recommended 2 GHz or more.
Operating System.
Tkinter Programming:-
Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides
a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented
interface to the Tk GUI toolkit. Creating a GUI application using Tkinter is an easy task. All
you need to do is perform the following steps –
• Enter the main event loop to take action against each event triggered by the user.
Example:
import tkinter
top = tkinter.Tk()
# Code to add widgets will go here...
top.mainloop()
This would create a following window −
Tkinter Widgets:
Tkinter provides various controls, such as buttons, labels and text boxes used in a GUI
application. These controls are commonly called widgets.
There are currently 15 types of widgets in Tkinter. We present these widgets as well as a
brief description in the following table –
Sr No. Operator And Description
1 Button
The Button widget is used to dispay buttons in your application
2 Canvas
The Canvas widget is used to draw shapes, such as lines, ovals, polygons and rectangles,
in your application
3 Checkbutton
The checkbutton widget is used to display a number of options as checkboxes. The user
can select multiple option at a time.
4 Entry
The entry widget is used to display a single-line text field for accepting values from user
5 Frame
The frane widget is used as a container widget to organize other widgets.
6 Label
The Lable widget is used to provide a single line caption for other widgets. It can also
contain images.
7 Listbox
The listbox widget is used to provie a list of options to a user
8 Menubutton
The menubutton widget is used to display menus in your application.
9 Menu
The menu widget is used to provide various commands to a user.These commands are
contained inside menubutton.
10 Message
The message widget is used to display multiline text fields for acceptinv values from a
user.
11 Radiobutton
The radiobutton widget is used to display a number of options as radio buttons. The user
can select only one option at a time.
12 Scale
The scale widget is used to provide a slider widget.
13 Text
The text widget is used to display text in multiple lines.
14 Toplevel
The toplevel widget is used to provide a separate windeow container.
15 Scrollbar
The scrollbar widget is used to add scrolling capability to various widgets, such as list
boxes.
16 Spinbox
The spinbox widget is a variant of the standard Tkinter entry widget, which can be used
to select from a fixed number of values.
17 PanedWindow
A panedwindow is a container widget that may contain any number of panes, arranged
horizontally or vertically.
18 LabelFrame
A labelframe is a simple container widget. Its primary purpose is to act as a spacer or
container for complex window layouts.
19 tkMessageBox
This module is used to display message boxes in your application.
Geometry Management:
All Tkinter widgets have access to specific geometry management methods, which have the
purpose of organizing widgets throughout the parent widget area.
Tkinter exposes the following geometry manager classes: pack, grid and place.
The pack() Method:- This geometry manager organizes widgets in blocks before placing them
in the parent widget.
The grid() Method:- This geometry manager organizes widgets in a table like structure in the
parent widget.
The place() Method:- This geometry manager organizes widgets by placing them in a specifi
position in the parent widget.
CHAPTER 4 – OUTCOME OF PROJECT REFERECES
This application generates employee payslip for the employees. In this application we have to give inputs like
employee name, rate per hour, duty (no. of hours),overtime (no. of hours), health insurance, other loans. When the
inputs are filled then we have to click on the ‘Calculate button’ and the application will generate payslip for that
employee.
You don’t have to worry about handling, managing, and creating payslips, salaries, and deductions of the
employees. The tax deductions are also automated or handled by the outsourcing team. You only have to focus on
major tasks such as the efficiency of sales, revenue, strategy, etc.
GUI – Main display window with name of the Employee Payment Management System
INPUT INTERFACE
Output interface:
CHAPTER 5 - C ONCLUSION
This project has really been faithful and informative. It has made us learn and understand the many trivial
concepts of Python Language. As we have used python Tkinter as a GUI it provides various controls, such as
buttons, labels and text boxes to build a user friendly application.
Finally it has taught us a valuable lifelong lesson about the improvements and working and interacting in a
group.
SOURCE CODE :-