You are on page 1of 30

THIRD YEAR INDUSTRIAL TRAINING SEMINAR REPORT

Python Developer

Submitted in partial fulfilment of the degree of Bachelor of Technology


Rajasthan Technical University

By

OJAL PUNDHIR

[PIET20CS128]

DEPARTMENT OF COMPUTER ENGINEERING


POORNIMA INSTITUTE OF ENGINEERING & TECHNOLOGY, JAIPUR
(Academic Year 2022-23)
i
RAJASTHAN TECHNICAL UNIVERSITY

POORNIMA INTITUTE OF ENGINEERING AND TECHNOLOGY, JAIPUR

CERTIFICATE

This is to certify that Third Year Industrial Training Seminar Report entitled Python Developer has been
submitted by OJAL PUNDHIR (PIET20CS128) for partial fulfillment of the Degree of Bachelor of
Technology of Rajasthan Technical University. It is found satisfactory and approved for submission

Date: 10/10/2022

Deepak Moud Dr. Dinesh Goyal


HOD CS Dept. Director
PIET, Jaipur PIET, Jaipur

ii
Certificate Issued By Grras Solutions

iii
DECLARATION

I hereby declare that the Industrial Training Seminar report entitled Python Developer was
carried out and written by me under the guidance of Ms. RITU SHUKLA and MR. VIVEK
SAXENA Assistant Professor, Department of Computer Science and Engineering, Poornima
Institute of Engineering & Technology, Jaipur. This work has not been previously formed the
basis for the award of any degree or diploma or certificate nor has been submitted elsewhere for
the award of any degree or diploma.

Place : Jaipur OJAL PUNDHIR


Date : 10 October 2022 (PIET20CS128)

iv
ACKNOWLEDGEMENT

A project of such a vast coverage cannot be realized without help from numerous sources and
people in the organization. I am thankful to Dr. Dinesh Goyal, Director, PIET for providing me
a platform to carry out such a training successfully.
I am also very grateful to Dr. Deepak Moud (HOD, CS) for his kind support.
I would like to take this opportunity to show my gratitude Ms. RITU SHUKLA and MR.
VIVEK SAXENA who helped me in successful completion of my third Year Industrial Training.
They have guided, motivated & were source of inspiration for me to carry out the necessary
proceedings for the training to be completed successfully. I am also grateful to the Dr. Anil
Kumar for his guidance and support.
I am thankful to Mr. Ravi Ramwat for his kind support and providing me expertise of the
domain to develop the project. I would also like to express my hearts felt appreciation to all of
my friends whose direct or indirect suggestions help me to develop this project [and to entire
team members for their valuable suggestions. Lastly, thanks to all faculty members of Computer
Science department for their moral support and guidance.

Submitted By:
OJAL PUNDHIR

v
ABSTRACT

College Management System gives us an edge to manage our college services include fee
Management and canteen orders. College Management will help to student to give their order
online as well as manage bills in their account.
The website always ask for id and password then all the resources are accessible to it. The
Technology usually used in making is basic frontend using HTML,CSS, JavaScript.
Then frames and backend code is done through Flask and Python . Database used is Sqllite.

Keywords:
HTML,CSS,JavaScript,Python,Flask

vi
Tables Of Contents

S.No Content Page.No.


1 Title Page i
2 Certificate ii
3 Certificate From Company iii
4 Declarartion iv
5 Acknowledgement v
6 Abstract vi
7 Table of Contents vii
8 List of Figures viii
Chapter 1: Introduction
9
1.1 Introduction to Python 1
1.2 Basic of Python Data Types 3
1.3 Python OOP Concept 5
10 Chapter 2: Flask and SQLite
2.1 Introduction to Flask 9
2.2 Introduction to SQLite 13
11 Chapter 3 : Training details and Project
3.1 Learning Outcomes 17
3.2 Why Python 17
3.3 Python Snapshot and Training Snapshot 20
12 Chapter 4: References

vii
List of Figures

FIGURE NO TITLE PAGE NO

Fig.1 Data Type 3


Fig 2 OOP Concept 6
Fig 3 sql vs sqlite 16
Fig 4 Python Developer Salary 18
Fig 5 Interest over time chart 18
Fig 6 Data Science 19
Fig 7 Project Screenshot 21
Fig 8 Project Screenshot 22
Fig 9 Company Pictures 23

viii
Python Developer ITS Report

Chapter 1
Introduction
1.1 Introduction to Python

Python is a widely used general-purpose, high level programming language. It was created
by Guido van Rossum in 1991 and further developed by the Python Software Foundation. It
was designed with an emphasis on code readability, and its syntax allows programmers to
express their concepts in fewer lines of code.

Python is a programming language that lets you work quickly and integrate systems
more efficiently.

There are two major Python versions: Python 2 and Python 3. Both are quite different.
Reason for increasing popularity
Emphasis on code readability, shorter codes, ease of writing .Programmers can express
logical concepts in fewer lines of code in comparison to languages such as C++ or Java.
Python supports multiple programming paradigms, like object-oriented, imperative and
functional programming or procedural.There exists inbuilt functions for almost all of the
frequently used concepts. Philosophy is “Simplicity is the best”.

LANGUAGE FEATURES

 Interpreted

 There are no separate compilation and execution steps like C and C++.
 Directly run the program from the source code.
 Internally, Python converts the source code into an intermediate form called
bytecodes which is then translated into native language of specific computer to run
it.
 No need to worry about linking and loading with libraries, etc.

 Platform Independent

 Python programs can be developed and executed on multiple operating system


platforms.
 Python can be used on Linux, Windows, Macintosh, Solaris and many more.

1
Python Developer ITS Report

 Free and Open Source; Redistributable


 High-level Language
 In Python, no need to take care about low-level details such as managing the memory
used by the program.

 Simple

 Closer to English language;Easy to Learn


 More emphasis on the solution to the problem rather than the syntax

 Embeddable

 Python can be used within C/C++ program to give scripting capabilities for
the program’s users.
 Robust:

 Exceptional handling features


 Memory management techniques in built

Rich Library Support


The Python Standard Library is very vast.
Known as the “batteries included” philosophy of Python ;It can help do various things
involving regular expressions, documentation generation, unit testing, threading, databases,
web browsers, CGI, email, XML, HTML, WAV files, cryptography, GUI and many more.
Besides the standard library, there are various other high-quality libraries such as the Python
Imaging Library which is an amazingly simple image manipulation library.

Current Applications of Python

 A number of Linux distributions use installers written in Python example in Ubuntu we


have the Ubiquity
 Python has seen extensive use in the information security industry, including in
exploit development.
 Raspberry Pi– single board computer uses Python as its principal user-programming
language.
 Python is now being used Game Development areas also.

2
Python Developer ITS Report

1.2 Basics Of Python Data Type


Data types are the classification or categorization of data items. It represents the kind of
value that tells what operations can be performed on a particular data. Since everything is
an object in Python programming, data types are actually classes and variables are
instance (object) of these classes.

Following are the standard or built-in data type of Python:

 Numeric
 Sequence Type
 Boolean
 Set
 Dictionary

3
Python Developer ITS Report

 Numeric

In Python, numeric data type represent the data which has numeric value. Numeric value
can be integer, floating number or even complex numbers. These values are defined as
int, float and complex class in Python

 Integers – This value is represented by int class. It contains positive or negative


whole numbers (without fraction or decimal). In Python there is no limit to how
long an integer value can be.
 Float – This value is represented by float class. It is a real number with floating
point representation. It is specified by a decimal point. Optionally, the character e or
E followed by a positive or negative integer may be appended to specify scientific
notation.
 Complex Numbers – Complex number is represented by complex class. It is
specified as (real part) + (imaginary part)j. For example – 2+3j

 Sequence
In Python, sequence is the ordered collection of similar or different data types. Sequences
allows to store multiple values in an organized and efficient fashion. There are several
sequence types in Python –

 String
 List
 Tuple
1) String
In Python, Strings are arrays of bytes representing Unicode characters. A string is a
collection of one or more characters put in a single quote, double-quote or triple quote. In
python there is no character data type, a character is a string of length one. It is
represented by str class.
2) List
Lists are just like the arrays, declared in other languages which is a ordered collection of
data. It is very flexible as the items in a list do not need to be of the same type.
3) Tuple
Just like list, tuple is also an ordered collection of Python objects. The only difference
between tuple and list is that tuples are immutable i.e. tuples cannot be modified after it is
created. It is represented by tuple class.
 Boolean

4
Python Developer ITS Report

Data type with one of the two built-in values, True or False. Boolean objects that are
equal to True are truthy (true), and those equal to False are falsy (false). But non-Boolean
objects can be evaluated in Boolean context as well and determined to be true or false. It
is denoted by the class bool.

 Set
In Python, Set is an unordered collection of data type that is iterable, mutable and has no
duplicate elements. The order of elements in a set is undefined though it may consist of various
elements.

 Dictionary
Dictionary in Python is an unordered collection of data values, used to store data values
like a map, which unlike other Data Types that hold only single value as an element,
Dictionary holds key:value pair. Key-value is provided in the dictionary to make it more
optimized. Each key-value pair in a Dictionary is separated by a colon :, whereas each
key is separated by a ‘comma’.

1.3 Python OOP Concept

In Python, object-oriented Programming (OOPs) is a programming paradigm that uses objects


and classes in programming. It aims to implement real-world entities like inheritance,
polymorphisms, encapsulation, etc. in the programming. The main concept of OOPs is to bind
the data and the functions that work on that together as a single unit so that no other part of the
code can access this data.

Main Concepts of Object-Oriented Programming (OOPs)

 Class
 Objects
 Polymorphism
 Encapsulation
 Inheritance
 Data Abstraction

5
Python Developer ITS Report

 Class
A class is a collection of objects. A class contains the blueprints or the prototype from which
the objects are being created. It is a logical entity that contains some attributes and methods.

To understand the need for creating a class let’s consider an example, let’s say you wanted to
track the number of dogs that may have different attributes like breed, age. If a list is used,
the first element could be the dog’s breed while the second element could represent its age.
Let’s suppose there are 100 different dogs, then how would you know which element is
supposed to be which? What if you wanted to add other properties to these dogs? This lacks
organization and it’s the exact need for classes.

Some points on Python class:


 Classes are created by keyword class.
 Attributes are the variables that belong to a class.

6
Python Developer ITS Report

 Attributes are always public and can be accessed using the dot (.) operator. Eg.:
Myclass.Myattribute

 Objects
The object is an entity that has a state and behavior associated with it. It may be any real-
world object like a mouse, keyboard, chair, table, pen, etc. Integers, strings, floating-point
numbers, even arrays, and dictionaries, are all objects. More specifically, any single integer
or any single string is an object. The number 12 is an object, the string “Hello, world” is an
object, a list is an object that can hold other objects, and so on. You’ve been using objects all
along and may not even realize it.

An object consists of :

 State: It is represented by the attributes of an object. It also reflects the properties of an


object.
 Behavior: It is represented by the methods of an object. It also reflects the response of an
object to other objects.
 Identity: It gives a unique name to an object and enables one object to interact with other
objects.
 Inheritance

Inheritance is the capability of one class to derive or inherit the properties from another
class. The class that derives properties is called the derived class or child class and the
class from which the properties are being derived is called the base class or parent
class. The benefits of inheritance are:
 It represents real-world relationships well.
 It provides the reusability of a code. We don’t have to write the same code again
and again. Also, it allows us to add more features to a class without modifying it.
 It is transitive in nature, which means that if class B inherits from another class A,
then all the subclasses of B would automatically inherit from class A.

Types of Inheritance –

Single Inheritance:

Single-level inheritance enables a derived class to inherit characteristics from a single-


parent class.
Multilevel Inheritance:

7
Python Developer ITS Report

Multi-level inheritance enables a derived class to inherit properties from an immediate


parent class which in turn inherits properties from his parent class.
Hierarchical Inheritance:

Hierarchical level inheritance enables more than one derived class to inherit properties
from a parent class.

Multiple Inheritance:

Multiple level inheritance enables one derived class to inherit properties from more
than one base class.

 Polymorphism
Polymorphism simply means having many forms. For example, we need to determine
if the given species of birds fly or not, using polymorphism we can do this using a
single function.

 Encapsulation
Encapsulation is one of the fundamental concepts in object-oriented programming
(OOP). It describes the idea of wrapping data and the methods that work on data within
one unit. This puts restrictions on accessing variables and methods directly and can
prevent the accidental modification of data. To prevent accidental change, an object’s
variable can only be changed by an object’s method. Those types of variables are known
as private variables.

A class is an example of encapsulation as it encapsulates all the data that is member


functions, variables, etc.

 Data Abstraction

It hides the unnecessary code details from the user. Also, when we do not want to give
out sensitive parts of our code implementation and this is where data abstraction came.
Data Abstraction in Python can be achieved through creating abstract classe

8
Python Developer ITS Report

Chapter 2
Flask and SQL lite
2.1 Introduction to flask

What is Flask?

Flask is an API of Python that allows us to build up web-applications. It was developed by


Armin Ronacher. Flask’s framework is more explicit than Django’s framework and is also
easier to learn because it has less base code to implement a simple web-Application. A Web-
Application Framework or Web Framework is the collection of modules and libraries that
helps the developer to write applications without writing the low-level codes such as
protocols, thread management, etc. Flask is based on WSGI(Web Server Gateway Interface)
toolkit and Jinja2 template engine.

Routing:
Nowadays, the web frameworks provide routing technique so that user can remember the
URLs. It is useful to access the web page directly without navigating from the Home page.
It is done through the following route() decorator, to bind the URL to a function.

# decorator to route URL

@app.route(‘/hello’)

# binding to the function of route

def hello_world():

return ‘hello world’

Sessions in Flask:
In Session, the data is stored on Server. It can be defined as a time interval in which the
client logs into a server until the user logs out. The data in between them are held in a
temporary folder on the Server. Each user is assigned with a specific Session ID. The Session
object is a
9
Python Developer ITS Report

dictionary that contains the key-value pair of the variables associated with the session. A
SECRET_KEY is used to store the encrypted data on the cookie.

For example:

Session[key] = value // stores the session value


Session.pop(key, None) // releases a session variable

Other Important Flask Functions:


redirect(): It is used to return the response of an object and redirects the user to another target
location with specified status code.

Syntax: Flask.redirect(location, statuscode, response)


//location is used to redirect to the desired URL
//statuscode sends header value, default 302
//response is used to initiate response.

abort: It is used to handle the error in the code.

Syntax: Flask.abort(code)
The code parameter can take the following values to handle the error accordingly:

400 – For Bad Request


401 – For Unauthenticated
403 – For Forbidden request
404 – For Not Found
406 – For Not acceptable
425 – For Unsupported Media
429 – Too many Requests

10
Python Developer ITS Report

File-Uploading in Flask:
File Uploading in Flask is very easy. It needs an HTML form with enctype attribute and
URL handler, that fetches file and saves the object to the desired location. Files are
temporary stored on server and then on the desired location.
The HTML Syntax that handle the uploading URL is :

form action="http://localhost:5000/uploader" method="POST" enctype="multipart/form-


data"
and following python code of Flask is:

from flask import Flask, render_template, request


from werkzeug import secure_filename
app = Flask( name )

@app.route('/upload')
def upload_file():
return render_template('upload.html')

@app.route('/uploader', methods = ['GET', 'POST'])


def upload_file():
if request.method == 'POST':
f = request.files['file']
f.save(secure_filename(f.filename))
return 'file uploaded successfully'

if name == ' main ':


app.run(debug = True)

11
Python Developer ITS Report

Using Variables in Flask:

The Variables in the flask is used to build a URL dynamically by adding the variable parts to
the rule parameter. This variable part is marked as. It is passed as keyword argument. See
the example below

from flask import


Flask app = Flask(
name )

# routing the decorator function hello_name


@app.route('/hello/<name>')
def hello_name(name):
return 'Hello %s!' % name

if name == ' main ':


app.run(debug = True)

Building URL in FLask:

Dynamic Building of the URL for a specific function is done using url_for() function. The
function accepts the name of the function as first argument, and one or more keyword
arguments. See this example

from flask import Flask, redirect, url_for


app = Flask( name )

@app.route('/admin') #decorator for route(argument) function


def hello_admin(): #binding to hello_admin call
12
Python Developer ITS Report

return 'Hello Admin'

@app.route('/guest/<guest>')
def hello_guest(guest): #binding to hello_guest call
return 'Hello %s as Guest' % guest

@app.route('/user/<name>')
def hello_user(name):
if name =='admin': #dynamic binding of URL to function
return redirect(url_for('hello_admin'))
else:
return redirect(url_for('hello_guest', guest = name))

if name == ' main ':


app.run(debug = True)

2.2 SQL-Lite

SQLite is a self-contained, high-reliability, embedded, full-featured, public-domain, SQL


database engine. It is the most used database engine in the world. It is an in-process library
and its code is publicly available. It is free for use for any purpose, commercial or private.
It is basically an embedded SQL database engine. Ordinary disk files can be easily read and
write by SQLite because it does not have any separate server like SQL. The SQLite
database file format is cross-platform so that anyone can easily copy a database between
32-bit and 64-bit systems. Due to all these features, it is a popular choice as an Application
File Format.

History:
It was designed by D. Richard Hipp for the purpose of no administration required for
operating a program. in August 2000. As it is very lightweight compared to others like
MySql and Oracle, it is called SQLite. Different versions of SQLite are released since
2000.

13
Python Developer ITS Report

Features of SQLite

The transactions follow ACID properties i.e. atomicity, consistency, isolation, and durability
even after system crashes and power failures.
The configuration process is very easy, no setup or administration needed.
All the features of SQL are implemented in it with some additional features like partial
indexes, indexes on expressions, JSON, and common table expressions.
Sometimes it is faster than the direct file system I/O.
It supports terabyte-sized databases and gigabyte-sized strings and blobs.
Almost all OS supports SQLite like Android, BSD, iOS, Linux, Mac, Solaris, VxWorks, and
Windows (Win32, WinCE, etc. It is very much easy to port to other systems.
Complete database can be stored in a single cross-platform disk file.

Applications of SQLite

Due to its small code print and efficient usage of memory, it is the popular choice for the
database engine in cellphones, PDAs, MP3 players, set-top boxes, and other electronic
gadgets.
It is used as an alternative for open to writing XML, JSON, CSV or some proprietary
format into disk files used by the application.
As it has no complication for configuration and easily stores file in an ordinary disk file, so it
can be used as a database for small to medium sized websites.
It is faster and accessible through a wide variety of third-party tools, so it has great
application in different software platforms.

Some DDL and DML Commands


It is same as compared to previous technology like MySQL, Oracle.

Creating Table:
CREATE TABLE STUDENT(

14
Python Developer ITS Report

ID INT PRIMARY KEY NOT


NULL, NAME TEXT NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR(50),
FEES REAL
);

Insert Command:

INSERT INTO STUDENT (ID, NAME, AGE, ADDRESS, FEES)


VALUES (1, 'Sunil', 28, 'Mumbai', 20000.00);

Drop Table:

Drop Table Student;

15
Python Developer ITS Report

16
Python Developer ITS Report

Chapter 3
Training Detail and Project

3.1 Learning Objectives

The learning objectives of this course are:

 To understand why Python is a useful scripting language for developers.


 To learn how to design and program Python applications.
 To learn how to use lists, tuples, and dictionaries in Python programs.
 To learn how to identify Python object types.
 To learn how to use indexing and slicing to access data in Python programs.
 To define the structure and components of a Python program.
 To learn how to write loops and decision statements in Python.
 To learn how to write functions and pass arguments in Python.
 To learn how to build and package Python modules for reusability.
 To learn how to read and write files in Python.
 To learn how to design object‐oriented programs with Python classes.
 To learn how to use class inheritance in Python for reusability.
 To learn how to use exception handling in Python applications for error handling.

3.2 Why Python:

 Caarer Opportunities and salary

Python language provides several job opportunities and promises high growth with huge
salary prospects. Some of the big and renowned companies that use Python for their
development are:

17
Python Developer ITS Report

 Data Science

Python is known for being robust, scalable and provides extensible visualization and
graphics options. Hence it’s widely used in Data Science. Python supports several
popular libraries. Some of them are as follows:

18
Python Developer ITS Report

19
Python Developer ITS Report

3.3 Project Snapshot and Training Snapshot

20
Python Developer ITS Report

Company Screenshot

21
Python Developer ITS Report

Chapter 4
References

References

 https://grras.com/
 https://www.w3schools.com/
 https://www.geeksforgeeks.org/
 https://www.youtube.com/watch?v=6iCHf7OZn6c&list=PL6Zs6LgrJj3tDXv8a_elC
6eT_4R5gfX4d
 Programmiz.com
 Javatpoint.com
 Realpython.com

22

You might also like