Fantasy Cricket Game Using Python Report (20BCS1062)
Fantasy Cricket Game Using Python Report (20BCS1062)
On
FANTASY CRICKET GAME IN PYTHON
Bachelor of Engineering
in
COMPUTER SCIENCE & ENGINEERING
UID: 20BCS1062
(Signature of student)
Name of Student: Drishti Solanki
ACKNOWLEDGEMENT
1. Introduction to Python
2. Python Features
3. Training Contents
4. Profile of the Problem
5. Database Design
6. Screenshots
7. Coding
8. Bibliography
INTRODUCTION TO PYTHON
Python is a programming language that lets you work quickly and integrate systems
more efficiently. Python is a high-level, interpreted, interactive and object-oriented
scripting language. Python is designed to be highly readable. It uses English
keywords frequently where as other languages use punctuation, and it has fewer
syntactical constructions than other languages.
• Python is Interactive - You can actually sit at a Python prompt and interact
with the interpreter directly to write your programs.
Python was developed by Guido van Rossum in the late eighties and early nineties at
the National Research Institute for Mathematics and Computer Science in the
Netherlands. Python is derived from many other languages, including ABC, Modula-3,
C, C++, Algol-68, Small Talk, and Unix shell and other scripting languages. Python is
copyrighted. Like Perl, Python source code is now available under the GNU General
Public License (GPL). Python is now maintained by a core development team at the
institute, although Guido van Rossum still holds a vital role in directing its progress.
PYTHON FEATURES
• Easy-to-read - Python code is more clearly defined and visible to the eyes.
• A broad standard library - Python's bulk of the library is very portable and cross-
platform compatible on UNIX, Windows, and Macintosh.
• Interactive Mode - Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.
• Portable - Python can run on a wide variety of hardware platforms and has the
same interface on all platforms.
• Extendable - You can add low-level modules to the Python interpreter. These
modules enable programmers to add to or customize their tools to be more
efficient.
• GUI Programming - Python supports GUI applications that can be created and
ported to many system calls, libraries and windows systems, such as Windows
MFC, Macintosh, and the X Window system of Unix.
• Scalable - Python provides a better structure and support for large programs than
shell scripting.
Apart from the above-mentioned features, Python has a big list of good features, few
are listed below –
1. Introduction to Python
Learn how to install Python, distinguish between important data types and use
basic features of the Python interpreter, IDLE.
GUI:- Graphical user interface (GUI), a computer program that enables a person to
communicate with a computer through the use of symbols, visual metaphors, and
pointing devices. Best known for its implementation in Apple Inc.’s Macintosh and
Microsoft Corporation’s Windows operating system, the GUI has replaced the arcane
and difficult textual interfaces of earlier computing with a relatively intuitive system that
has made computer operation not only easier to learn but more pleasant and natural.
The GUI is now the standard computer interface, and its components have
themselves become unmistakable cultural artifacts.
PyQT :- PyQt is a GUI widgets toolkit. It is a Python interface for Qt, one of the most
powerful, and popular cross-platform GUI library. PyQt was developed by RiverBank
Computing Ltd. The latest version of PyQt can be downloaded from its official website.
PyQt is a blend of Python programming language and the Qt library. PyQT API is a
collection of more than 400 classes.
Qt Designer
Qt Designer is the Qt tool for designing and building graphical user interfaces (GUIs)
with Qt Widgets. You can compose and customize your windows or dialogs in a what-
you-see-is -what.
you-get (WYSIWYG) manner, and test them using different styles and resolutions.
Widgets and forms created with Qt Designer integrate seamlessly with programmed
code, using Qt's signals and slots mechanism, so that you can easily assign behavior
to graphical elements.
All properties set in Qt Designer can be changed dynamically within the code.
Furthermore, features like widget promotion and custom plugins allow you to use your
own components with Qt Designer.
Qt Designer helps only in designing GUI file, then it needs to be converted into py file.
By using pyuic 5 utility xml file can be converted into .py file and is installed along with
PyQT5 package.
We use pyuic5-x myui.ui-o myui.py command to convert ui file to python file. For the
sake of simplicity, we place myuic.ui file in the same folder where pyuic5.exe file is
placed.
PROFILE OF THE PROBLEM
Create a Fantasy Cricket game in Python. The game should have all the features
displayed in the mock-up screens in the scenario. To calculate the points for each
player, we can use rules similar to the sample rules displayed below.
Sample of Rules
Batting
Bowling
Fielding
For the database, you are required to use three tables – match, stats and
teams.
Match
Player Scored Faced Fours Sixes Bowle Maide Given Wkts Catche Stumpin RO*
d n s g
*Run Out
Teams
name players value
Stats
Opening screen of the application. You can see the players of each category by
selecting the category. To begin with, the selection is disabled until a new team is
created from the Manage Teams menu. A pop up asking the name of the team
appears.
The toolbar menu options which allow you to create a new team, open an existing
team, save your team and finally evaluate the score of a saved team.
After clicking New Team, the left box is populated with player names. As you select a
different category, the corresponding list of players is displayed.
On double-clicking each player name, the right box gets populated. Points available
and used are displayed accordingly.
Problem Analysis
This software is created for motivating street cricket and adding more fun and
entertainment to cricket. The components that are used in this demo can be
integrated to a high extent to provide statics to different components of cricket. This
project helps in providing real time on field actions there by helping its user of the
current actions happening on field.
Coding
Conclusion
• I believe the trial has shown conclusively that it is both possible and desirable
to use Python as the principal teaching language.
https://trainings.internshala.com/python-training
https://www.w3schools.com/python/
https://wiki.python.org/moin/PyQt/Tutorials
https://www.tutorialspoint.com/pyqt/
https://www.tutorialspoint.com/sqlite/sqlite_quick_guide.html