Академический Документы
Профессиональный Документы
Культура Документы
Report
On
In partial fulfilment
“Bachelor of Technology”
i
Acknowledgement
It is our proud privilege and duty to acknowledge the kind of help and guidance received from
several people in preparation of this report. It would not have been possible to prepare this
report in this form without their valuable help, cooperation and guidance.
The seminar on “Python” was very helpful to us in giving the necessary background information
and inspiration in choosing this topic for the seminar. Their contributions and technical support
in preparing this report are greatly acknowledged.
Last but not the least, we wish to thank our parents for financing our studies in this college as
well as for constantly encouraging us to learn engineering. Their personal sacrifice in providing
this opportunity to learn engineering is gratefully acknowledged.
ii
Certificate of Training
iii
Table of Contents
iv
Introduction to the Company
Name: Simplilearn.
CEO: Krishna Kumar
BOD: Ram Gupta, Dr. Ashish Gupta.
v
History of python
vi
Release Date of Python Version
Python Releases
Python 1.0 - January 1994
Python 1.5 - December 31, 1997
Python 1.6 - September 5, 2000
Python 2.0 - October 16, 2000
Python 2.1 - April 17, 2001
Python 2.2 - December 21, 2001
Python 2.3 - July 29, 2003
Python 2.4 - November 30, 2004
Python 2.5 - September 19, 2006
Python 2.6 - October 1, 2008
Python 2.7 - July 3, 2010
Python 3.0 - December 3, 2008
Python 3.1 - June 27, 2009
Python 3.2 - February 20, 2011
Python 3.3 - September 29, 2012
Python 3.4 - March 16, 2014
Python 3.5 - September 13, 2015
Python 3.6 - December 23, 2016
vii
Why Python ?
The language's core philosophy is summarized in the document The Zen of Python (PEP 20), which
includes aphorisms such as…
Beautiful is better than ugly
Simple is better than complex
Complex is better than complicated
Readability counts
Explicit is better than implicit
viii
Characteristics of Python
ix
Data Type in Python
LISTS-
Example-
Dictionary-
Constructing a dictionary.
Nesting Dictionaries.
Basic Syntax
o d={} empty dictionary will be generated and assign keys and values to it, like d[‘animal’]
= ‘Dog’
x
o d = {'K1':'V1', 'K2’:’V2'}
Tuples-
Immutable in nature, i.e they cannot be changed.
No type restriction
Indexing and slicing, everything's same like that in strings and lists.
Constructing tuples.
Basic tuple methods.
Immutability.
When to use tuples?
We can use tuples to present things that shouldn’t change, such as days of the week, or dates on a
calendar, etc.
Sets-
A set contains unique and unordered elements and we can construct them by using a set() function.
Convert a list into Set-
l=[1,2,3,4,1,1,2,3,6,7]
k = set(l)
k becomes {1,2,3,4,6,7}
Basic Syntax-
x=set()
x.add(1)
x = {1}
x.add(1)
This would make no change in x now
xi
File Handling in Python
Python too supports file handling and allows users to handle files i.e., to read and write files,
along with many other file handling options, to operate on files. The concept of file handling
has stretched over various other languages, but the implementation is either complicated or
lengthy, but alike other concepts of Python, this concept here is also easy and short. Python
treats file differently as text or binary and this is important. Each line of code includes a
sequence of characters and they form text file. Each line of a file is terminated with a special
character, called the EOL or End of Line characters like comma {,} or newline character. It
ends the current line and tells the interpreter a new one has begun. Let’s start with Reading
and Writing files.
We use open () function in Python to open a file in read or write mode. As explained above,
open ( ) will return a file object. To return a file object we use open () function along with
two arguments, that accepts file name and the mode, whether to read or write. So, the syntax
being: open(filename, mode). There are three kinds of mode, that Python provides and how
files can be opened:
• “ r “, for reading.
• “ w “, for writing.
• “ a “, for appending.
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 19 types of widgets in Tkinter. We present these widgets as well as a brief
description in the following table –
xii
Operator & Description
1 Button
2 Canvas
The Canvas widget is used to draw shapes, such as lines, ovals, polygons and rectangles, in
your application.
3 Check button
The Check button widget is used to display a number of options as checkboxes. The user can
select multiple options at a time.
4 Entry
The Entry widget is used to display a single-line text field for accepting values from a user.
5 Frame
6 Label
The Label widget is used to provide a single-line caption for other widgets. It can also
contain images.
7 Listbox
8 Menu button
9 Menu
The Menu widget is used to provide various commands to a user. These commands are
contained inside Menu button.
10 Message
xiii
The Message widget is used to display multiline text fields for accepting values from a user.
11 Radio button
The Radio button widget is used to display a number of options as radio buttons. The user can
select only one option at a time.
12 Scale
13 Scrollbar
The Scrollbar widget is used to add scrolling capability to various widgets, such as list boxes.
14 Text
15 Top level
16 Spin box
The Spin box widget is a variant of the standard Tkinter Entry widget, which can be used to
select from a fixed number of values.
17 Paned Window
A Paned Window is a container widget that may contain any number of panes, arranged
horizontally or vertically.
18 Label Frame
A label frame is a simple container widget. Its primary purpose is to act as a spacer or
container for complex window layouts.
19 tkMessageBox
xiv
Limitation and Scope
Limitations of Python:
According to many surveys, Python is one of the most widely used programming languages
of 2015. In addition to being simple and easy-to-learn, Python enables developers to express
concepts without writing longer lines of code. The simple syntax and readable code make it
easier for developers to maintain applications written in Python. Python also has a robust
standard library, which enables web programmers to accomplish common programming tasks
like web service implementation, string operations, operating system interfaces management,
and working with internet protocols without writing additional code. They can use specific
frameworks to use Python for developing web applications, desktop GUI applications, and
scientific and numeric application and cross-platform mobile apps. But Python, like other
programming languages, has several shortcomings. It’s essential for programmers to know
some of the major limitations of Python programming language. 10 Important Shortcomings
of Python Programming Language:-
1) Performance and Speed Many studies have proved that Python is slower than other modern
programming languages like Java and C++. So the developers have to frequently explore
ways to enhance the Python application’s speed. However, they have a number of options to
make the applications written in Python run faster. For instance, the developers can create a
custom runtime, and use it instead of the default runtime of the programming language.
Likewise, they can rewrite the existing Python code to take advantage of the existing
execution speed.
2) Incompatibility of Two Versions Beginners often find it pick and learn the right version of
Python. Officially, Python 2.x is described as legacy, whereas Python 3.x is described as
current and futuristic. But both versions of the programming language have been updated on
a regular basis. Also, a large percentage of programmers still prefer Python 2 to Python 3.
There are also a number of popular frameworks and libraries that support only Python 2.
xv
Python is a dynamically typed programming language. It does not require programmers to
define the type of a variable while declaring it. The feature makes it easier for programmers
to write code freely. But a number of critical bugs or defects emerge at the time of
compilation as the variable types are not defined explicitly. So the developers must perform a
number of tests additionally to identify and fix the bugs during runtime.
6) Weak in Mobile Computing The steady decline in mobile web usage has made it essential
for modern businesses to launch mobile apps. Often developers have to write mobile apps in
a particular programming language according to the targeted mobile platform. For instance,
they need to write iOS app in either Objective-C or Swift. Likewise, mobile apps for Android
need to be written in Java. But the developers cannot use Python directly for developing
mobile apps by targeting any popular mobile platforms. They have to use frameworks like
Kivy to build cross-platform mobile apps using Python.
8) No Option to Embed Block Comments Nowadays, developers are required to make the
application code readable and maintainable. While writing code, programmers frequently
deactivate a specific section or block of code by using block comments. Unlike other modern
programming languages, Python does not support block comments. Hence, the programmers
have to assess the quality of the code either by writing comments for each line of code or
removing a specific section of code at the time of execution. The lack of block comments
support requires programmers to put additional time and effort to assess the quality of Python
code.
xvi
9) Many Python Modules Lack Adequate Support
Python is supported by a large and active community. The members of the Python
community regularly share new packages or modules to make it easier for programmers to
add functionality to the application. But developers often complain that the quality of
individual Python modules or packages differs. Some of these packages lack adequate
support, and are not updated regularly. Hence, the programmers have to do some initial
research to pick the right packages or modules.
10) Does not Provide Prebuilt Statistical Models and Tests Many developers prefer using
Python for developing custom statistical and big data applications. But developers need to use
additional statistical and data analysis packages to write statistical applications more
efficiently. Also, they have to use specific libraries like Pygal, Seaborn and Bokeh to
accomplish data visualization. They cannot make the Python application present and analyze
huge volumes of data without using these libraries and tools. On the whole, the developers
can use Python to build a variety of software applications rapidly. But they have to use a
number of third-party libraries and frameworks additionally to overcome the limitations of
this high-level programming language. At the same time, they also need to explore ways to
enhance the performance and speed of the Python applications consistently. 6.2 Future scope
of Python
Python has been voted as most favorite programming language beating C, C++ and java
programming. Python programming is open source programming language. Python is being
used worldwide as a wide range of application development and system development
programming language. Big brands and search ensued to develop almost every kind of
application. Python is being used worldwide as a wide range of application development and
system development programming language. Chapter-7 API (Application Program Interface)
An application program interface (API) is code that allows two software programs to
communicate with each other. An API defines the correct way for a developer to request
services from an operating system (OS) or other application and expose data within different
contexts and across multiple channels. In the early days of Web 2.0, the concept of
integrating data and applications from different sources was called a mash up.
Any data can be shared with an application program interface. APIs are implemented by
function calls composed of verbs and nouns. The required syntax is described in the
documentation of the application being called. For example, on a real estate website, one API
might be used to publish available real estate properties by geography, while a second API
provides the visitor with current interest rates and third API brings in a mortgage calculator.
xvii
Exposing data with an API can improve the customer experience because it provides greater
functionality and scope of services within a single application or other digital property. By
anticipating the customer’s needs as they relate to searching for real estate, for example, the
company that publishes the website is not only increasing the value it delivers to users, it is
also opening up opportunities for new business partnerships with related service providers.
How APIs work APIs are made up of two related elements. The first is a specification that
describes how information is exchanged between programs, done in the form of a request for
processing and a return of the necessary data. The second is a software interface written to
that specification and published in some way for use.
The software that wants to access the features and capabilities of the API is said to call it, and
the software that creates the API is said to publish it.
Three basic types of APIs APIs take three basic forms: private, public and partner.
Private APIs, or internal APIs, are published internally for use by the company’s developers
to improve its own products and services. Private APIs are not exposed to third parties.
Public APIs, or open APIs, are published publicly and can be used by any third-party. There
are no restrictions on these APIs.
Partner APIs can only be used by specific parties with whom the company agrees to share
data. Partner APIs are used within business relationships, often to integrate software between
partnering companies.
xviii
CONCLUSION
I believe the trial has shown conclusively that it is both possible and desirable to use Python
as the principal teaching language:
• It is trivial to install on a Windows PC allowing students to take their interest further. For
many the hurdle of installing a Pascal or C compiler on a Windows machine is either too
expensive or too complicated;
• It is a flexible tool that allows both the teaching of traditional procedural programming and
modern OOP.
• It is a real-world programming language that can be and is used in academia and the
commercial world.
• It appears to be quicker to learn and, in combination with its many libraries, this offers the
possibility of more rapid student development allowing the course to be made more
challenging and varied.
• And most importantly, its clean syntax offers increased understanding and enjoyment for
students.
The training program having three destination was a lot more useful than staying at one
place throughout the whole 4 weeks. In my opinion. I have gained lots of knowledge and
experience needed to be successful in great engineering challenge as in my opinion,
Engineering is after all a Challenge ,and not a job .
xix