SlideShare a Scribd company logo
Libraries
Prof. K. Adisesha
2
Learning objectives
• Understanding Library
• Importing Modules in Python Program
• Using Standard Library’s functions
• Creating a Python Library
3
What is a Library?
• A Library refers to a collection of modules that together
cater to specific types of needs or applications.
• Some Commonly used Python library are:
Library Functions
standard library This library is distributed with Python that contains modules for
various types of functionalities.
NumPy library This library provides some advance math functionalities along with
tools to create and manipulate numeric arrays.
SciPy library This is another useful library that offers algorithmic and
mathematical tools for scientific calculations.
tkinter library This library provides traditional Python user interface toolkit and
helps you to create user friendly GUI interface for different types
of applications.
Malplotlib library This library offers many functions and tools to produce quality
output in variety of formats such as plots, charts, graphs
4
Python standard library
• Some commonly used modules of Python standard library
are:
Library Functions
math module Provides mathematical functions to support different
types of calculations.
cmath module provides mathematical functions for complex numbers
random module provides functions for generating pseudo-random
numbers
statistics module provides mathematical statistics functions
Urllib module provides URL handling functions so that you can access
websites from within your program
5
What is a Module?
• Python module is a file(.py file) containing variables, class
definitions, statements and functions related to a particular task.
• A Module, in general:
 Is independent grouping of code and data
 Can be re-used in other programs.
 Can depend on other modules
6
Structure of a Python Module
• A Python module can contain much more than just functions.
• A Python module is a normal Python file (.py file) containing one or
more of the following objects related to a particular task:
• So, we can say that the module ‘ABC' means it is file ‘ABC.py’
Structure Task
docstrings triple quoted comments; useful for documentation purposes.
variables and
constants
labels for data
classes templates/blueprint to create objects of a certain kind
objects instances of classes. In general, objects are representation
of some real or abstract entity
statements Instructions for processing
functions named group of instructions
7
Importing Modules
• Python module files have an extension .py
• These modules can be imported in the following ways:
 import statement
- to import entire module
 from statement
- to import selected object
 from * statement
- import all names from the module
8
IMPORTING MODULES- import
• import statement is used to include the modules in other
programs.
 syntax : import <filename>
 example: import math
• more than one module can be inserted in a python program
 syntax : import <filename> ,<filename>,<filename>……
 example: import math,os
• using import statement one can view all the functions and
other attributes of a particular module
 example:
import math
dir(math)
9
IMPORTING MODULES- from
• importing module can be done using from statement
specific attributes can be included in other programs.
• syntax :
• from <filename> import function name
• example:
• from math import math.sqrt
10
IMPORTING MODULES- from*
• from* statement can be used to import all names from the
module in to the current calling name space.
• syntax :
from <filename> import *
• example:
from math import *
math.sqrt(4)
• we can access any function by using dot notation.
11
NAMESPACES
When we import modules in a particular program these modules will
become part of that program and are called as namespace.
Python implements namespaces in the form of dictionaries. It maintains a
name to object mapping.
There are three types of namespaces
1) Global
2) Local
3) Built in
Namespaces
12
MODULE ALIASING
• One can create an alias while importing module in a program
• Syntax:
import <filename> as <alias name>
• Example:
import math as m
m.sqrt(4)
• Like module aliasing members are also aliased
• syntax:
import <filename> as <alias name>,member as alias name
• Example:
import test as t, add as sum
test.py is module file and is referred to as t and add is the function,
it is referred to as sum.
13
PACKAGE/LIBRARY
• Python packages are the collection of related modules.
You can import a package or create your own.
• Python package is a simply directory of python modules
• Steps to create and import a package
1. create a directory named ‘Gemetry’
2. add modules area.py and volume.py
3. create a file __init__.py in directory ‘Geometry’. The __init__.py
files are required to make python treat the directory as containing
package
14
PACKAGE/LIBRARY
• What is __init__.py file?
• __init__.py is simply a file used to consider directories on the disk as
package of python.
• It is basically used to initilize the python package
• Python searches module in the following manner
• 1) Searches in current directory
• 2) If the module is not found then searches each directory in the shell variable
PYTHONPATH
• 3) If all else fails, python checks the default path which is the installation location
of the python
15
pip
• What is pip?
• pip is a package-management system used to install and manage
software packages written in Python.
• To check pip version run, pip --version at dos prompt
16
• We learned about the Python Library .
• Types of Libraries
• Modules in Python
• Packages in Python.
• We also looked at the creating PACKAGE/LIBRARY.
Thank you
Conclusion!
Ad

More Related Content

What's hot (20)

Python Libraries and Modules
Python Libraries and ModulesPython Libraries and Modules
Python Libraries and Modules
RaginiJain21
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
St. Petersburg College
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
nitamhaske
 
Lesson 03 python statement, indentation and comments
Lesson 03   python statement, indentation and commentsLesson 03   python statement, indentation and comments
Lesson 03 python statement, indentation and comments
Nilimesh Halder
 
Python : Functions
Python : FunctionsPython : Functions
Python : Functions
Emertxe Information Technologies Pvt Ltd
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
Devashish Kumar
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
Shivam Gupta
 
Introduction to Python
Introduction to Python  Introduction to Python
Introduction to Python
Mohammed Sikander
 
Python Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math modulePython Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math module
P3 InfoTech Solutions Pvt. Ltd.
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
What is Python Lambda Function? Python Tutorial | Edureka
What is Python Lambda Function? Python Tutorial | EdurekaWhat is Python Lambda Function? Python Tutorial | Edureka
What is Python Lambda Function? Python Tutorial | Edureka
Edureka!
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
Kamal Acharya
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
william john
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
Akhil Kaushik
 
Python basic
Python basicPython basic
Python basic
Saifuddin Kaijar
 
NumPy
NumPyNumPy
NumPy
AbhijeetAnand88
 
Python Libraries and Modules
Python Libraries and ModulesPython Libraries and Modules
Python Libraries and Modules
RaginiJain21
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
nitamhaske
 
Lesson 03 python statement, indentation and comments
Lesson 03   python statement, indentation and commentsLesson 03   python statement, indentation and comments
Lesson 03 python statement, indentation and comments
Nilimesh Halder
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
Devashish Kumar
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
Shivam Gupta
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
What is Python Lambda Function? Python Tutorial | Edureka
What is Python Lambda Function? Python Tutorial | EdurekaWhat is Python Lambda Function? Python Tutorial | Edureka
What is Python Lambda Function? Python Tutorial | Edureka
Edureka!
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
william john
 

Similar to Python libraries (20)

Using Python Libraries.pdf
Using Python Libraries.pdfUsing Python Libraries.pdf
Using Python Libraries.pdf
SoumyadityaDey
 
Object oriented programming design and implementation
Object oriented programming design and implementationObject oriented programming design and implementation
Object oriented programming design and implementation
afsheenfaiq2
 
Object oriented programming design and implementation
Object oriented programming design and implementationObject oriented programming design and implementation
Object oriented programming design and implementation
afsheenfaiq2
 
Class 12 CBSE Chapter: python libraries.pptx
Class 12 CBSE Chapter: python libraries.pptxClass 12 CBSE Chapter: python libraries.pptx
Class 12 CBSE Chapter: python libraries.pptx
AravindVaithianadhan
 
Python module 3, b.tech 5th semester ppt
Python module 3, b.tech 5th semester pptPython module 3, b.tech 5th semester ppt
Python module 3, b.tech 5th semester ppt
course5325
 
Using python libraries.pptx , easy ppt to study class 12
Using python libraries.pptx , easy ppt to study class 12Using python libraries.pptx , easy ppt to study class 12
Using python libraries.pptx , easy ppt to study class 12
anikedheikhamsingh
 
Modules and Packages in Python Programming Language.pptx
Modules and Packages in Python Programming Language.pptxModules and Packages in Python Programming Language.pptx
Modules and Packages in Python Programming Language.pptx
arunavamukherjee9999
 
Interesting Presentation on Python Modules and packages
Interesting Presentation on Python Modules and packagesInteresting Presentation on Python Modules and packages
Interesting Presentation on Python Modules and packages
arunavamukherjee9999
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
Haitham El-Ghareeb
 
Modules and Packages in Python_Basics.pdf
Modules and Packages in Python_Basics.pdfModules and Packages in Python_Basics.pdf
Modules and Packages in Python_Basics.pdf
RavindraTambe3
 
Python Modules, executing modules as script.pptx
Python Modules, executing modules as script.pptxPython Modules, executing modules as script.pptx
Python Modules, executing modules as script.pptx
Singamvineela
 
CBSE-Class 12-Ch4 -Using Python Libraries - SasikalaJayaprakash
CBSE-Class 12-Ch4 -Using Python Libraries - SasikalaJayaprakashCBSE-Class 12-Ch4 -Using Python Libraries - SasikalaJayaprakash
CBSE-Class 12-Ch4 -Using Python Libraries - SasikalaJayaprakash
ShivaniJayaprakash1
 
Python Modules
Python ModulesPython Modules
Python Modules
Nitin Reddy Katkam
 
CLASS-11 & 12 ICT PPT Functions in Python.pptx
CLASS-11 & 12 ICT PPT Functions in Python.pptxCLASS-11 & 12 ICT PPT Functions in Python.pptx
CLASS-11 & 12 ICT PPT Functions in Python.pptx
seccoordpal
 
Functions_in_Python.pptx
Functions_in_Python.pptxFunctions_in_Python.pptx
Functions_in_Python.pptx
krushnaraj1
 
CLTL python course: Object Oriented Programming (2/3)
CLTL python course: Object Oriented Programming (2/3)CLTL python course: Object Oriented Programming (2/3)
CLTL python course: Object Oriented Programming (2/3)
Rubén Izquierdo Beviá
 
jb_Modules_in_Python.pptx jb_Modules_in_Python.pptx
jb_Modules_in_Python.pptx jb_Modules_in_Python.pptxjb_Modules_in_Python.pptx jb_Modules_in_Python.pptx
jb_Modules_in_Python.pptx jb_Modules_in_Python.pptx
paurushsinhad
 
Functions_in_Python.pdf text CBSE class 12
Functions_in_Python.pdf text CBSE class 12Functions_in_Python.pdf text CBSE class 12
Functions_in_Python.pdf text CBSE class 12
JAYASURYANSHUPEDDAPA
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
 
Python. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdfPython. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdf
prasenjitghosh1998
 
Using Python Libraries.pdf
Using Python Libraries.pdfUsing Python Libraries.pdf
Using Python Libraries.pdf
SoumyadityaDey
 
Object oriented programming design and implementation
Object oriented programming design and implementationObject oriented programming design and implementation
Object oriented programming design and implementation
afsheenfaiq2
 
Object oriented programming design and implementation
Object oriented programming design and implementationObject oriented programming design and implementation
Object oriented programming design and implementation
afsheenfaiq2
 
Class 12 CBSE Chapter: python libraries.pptx
Class 12 CBSE Chapter: python libraries.pptxClass 12 CBSE Chapter: python libraries.pptx
Class 12 CBSE Chapter: python libraries.pptx
AravindVaithianadhan
 
Python module 3, b.tech 5th semester ppt
Python module 3, b.tech 5th semester pptPython module 3, b.tech 5th semester ppt
Python module 3, b.tech 5th semester ppt
course5325
 
Using python libraries.pptx , easy ppt to study class 12
Using python libraries.pptx , easy ppt to study class 12Using python libraries.pptx , easy ppt to study class 12
Using python libraries.pptx , easy ppt to study class 12
anikedheikhamsingh
 
Modules and Packages in Python Programming Language.pptx
Modules and Packages in Python Programming Language.pptxModules and Packages in Python Programming Language.pptx
Modules and Packages in Python Programming Language.pptx
arunavamukherjee9999
 
Interesting Presentation on Python Modules and packages
Interesting Presentation on Python Modules and packagesInteresting Presentation on Python Modules and packages
Interesting Presentation on Python Modules and packages
arunavamukherjee9999
 
Modules and Packages in Python_Basics.pdf
Modules and Packages in Python_Basics.pdfModules and Packages in Python_Basics.pdf
Modules and Packages in Python_Basics.pdf
RavindraTambe3
 
Python Modules, executing modules as script.pptx
Python Modules, executing modules as script.pptxPython Modules, executing modules as script.pptx
Python Modules, executing modules as script.pptx
Singamvineela
 
CBSE-Class 12-Ch4 -Using Python Libraries - SasikalaJayaprakash
CBSE-Class 12-Ch4 -Using Python Libraries - SasikalaJayaprakashCBSE-Class 12-Ch4 -Using Python Libraries - SasikalaJayaprakash
CBSE-Class 12-Ch4 -Using Python Libraries - SasikalaJayaprakash
ShivaniJayaprakash1
 
CLASS-11 & 12 ICT PPT Functions in Python.pptx
CLASS-11 & 12 ICT PPT Functions in Python.pptxCLASS-11 & 12 ICT PPT Functions in Python.pptx
CLASS-11 & 12 ICT PPT Functions in Python.pptx
seccoordpal
 
Functions_in_Python.pptx
Functions_in_Python.pptxFunctions_in_Python.pptx
Functions_in_Python.pptx
krushnaraj1
 
CLTL python course: Object Oriented Programming (2/3)
CLTL python course: Object Oriented Programming (2/3)CLTL python course: Object Oriented Programming (2/3)
CLTL python course: Object Oriented Programming (2/3)
Rubén Izquierdo Beviá
 
jb_Modules_in_Python.pptx jb_Modules_in_Python.pptx
jb_Modules_in_Python.pptx jb_Modules_in_Python.pptxjb_Modules_in_Python.pptx jb_Modules_in_Python.pptx
jb_Modules_in_Python.pptx jb_Modules_in_Python.pptx
paurushsinhad
 
Functions_in_Python.pdf text CBSE class 12
Functions_in_Python.pdf text CBSE class 12Functions_in_Python.pdf text CBSE class 12
Functions_in_Python.pdf text CBSE class 12
JAYASURYANSHUPEDDAPA
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
 
Python. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdfPython. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdf
prasenjitghosh1998
 
Ad

More from Prof. Dr. K. Adisesha (20)

Design and Analysis of Algorithms ppt by K. Adi
Design and Analysis of Algorithms ppt by K. AdiDesign and Analysis of Algorithms ppt by K. Adi
Design and Analysis of Algorithms ppt by K. Adi
Prof. Dr. K. Adisesha
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Operating System-4 "File Management" by Adi.pdf
Operating System-4 "File Management" by Adi.pdfOperating System-4 "File Management" by Adi.pdf
Operating System-4 "File Management" by Adi.pdf
Prof. Dr. K. Adisesha
 
Operating System-3 "Memory Management" by Adi.pdf
Operating System-3 "Memory Management" by Adi.pdfOperating System-3 "Memory Management" by Adi.pdf
Operating System-3 "Memory Management" by Adi.pdf
Prof. Dr. K. Adisesha
 
Operating System Concepts Part-1 by_Adi.pdf
Operating System Concepts Part-1 by_Adi.pdfOperating System Concepts Part-1 by_Adi.pdf
Operating System Concepts Part-1 by_Adi.pdf
Prof. Dr. K. Adisesha
 
Operating System-2_Process Managementby_Adi.pdf
Operating System-2_Process Managementby_Adi.pdfOperating System-2_Process Managementby_Adi.pdf
Operating System-2_Process Managementby_Adi.pdf
Prof. Dr. K. Adisesha
 
Software Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfSoftware Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfSoftware Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfSoftware Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfSoftware Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfSoftware Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfSoftware Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Prof. Dr. K. Adisesha
 
Computer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaComputer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. Adisesha
Prof. Dr. K. Adisesha
 
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaCCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
Prof. Dr. K. Adisesha
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
Prof. Dr. K. Adisesha
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. Adisesha
Prof. Dr. K. Adisesha
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdf
Prof. Dr. K. Adisesha
 
Introduction to Computers.pdf
Introduction to Computers.pdfIntroduction to Computers.pdf
Introduction to Computers.pdf
Prof. Dr. K. Adisesha
 
R_Programming.pdf
R_Programming.pdfR_Programming.pdf
R_Programming.pdf
Prof. Dr. K. Adisesha
 
Scholarship.pdf
Scholarship.pdfScholarship.pdf
Scholarship.pdf
Prof. Dr. K. Adisesha
 
Design and Analysis of Algorithms ppt by K. Adi
Design and Analysis of Algorithms ppt by K. AdiDesign and Analysis of Algorithms ppt by K. Adi
Design and Analysis of Algorithms ppt by K. Adi
Prof. Dr. K. Adisesha
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Operating System-4 "File Management" by Adi.pdf
Operating System-4 "File Management" by Adi.pdfOperating System-4 "File Management" by Adi.pdf
Operating System-4 "File Management" by Adi.pdf
Prof. Dr. K. Adisesha
 
Operating System-3 "Memory Management" by Adi.pdf
Operating System-3 "Memory Management" by Adi.pdfOperating System-3 "Memory Management" by Adi.pdf
Operating System-3 "Memory Management" by Adi.pdf
Prof. Dr. K. Adisesha
 
Operating System Concepts Part-1 by_Adi.pdf
Operating System Concepts Part-1 by_Adi.pdfOperating System Concepts Part-1 by_Adi.pdf
Operating System Concepts Part-1 by_Adi.pdf
Prof. Dr. K. Adisesha
 
Operating System-2_Process Managementby_Adi.pdf
Operating System-2_Process Managementby_Adi.pdfOperating System-2_Process Managementby_Adi.pdf
Operating System-2_Process Managementby_Adi.pdf
Prof. Dr. K. Adisesha
 
Software Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfSoftware Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfSoftware Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfSoftware Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfSoftware Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfSoftware Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Prof. Dr. K. Adisesha
 
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfSoftware Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Prof. Dr. K. Adisesha
 
Computer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaComputer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. Adisesha
Prof. Dr. K. Adisesha
 
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaCCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
Prof. Dr. K. Adisesha
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
Prof. Dr. K. Adisesha
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. Adisesha
Prof. Dr. K. Adisesha
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdf
Prof. Dr. K. Adisesha
 
Ad

Recently uploaded (20)

To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 

Python libraries

  • 2. 2 Learning objectives • Understanding Library • Importing Modules in Python Program • Using Standard Library’s functions • Creating a Python Library
  • 3. 3 What is a Library? • A Library refers to a collection of modules that together cater to specific types of needs or applications. • Some Commonly used Python library are: Library Functions standard library This library is distributed with Python that contains modules for various types of functionalities. NumPy library This library provides some advance math functionalities along with tools to create and manipulate numeric arrays. SciPy library This is another useful library that offers algorithmic and mathematical tools for scientific calculations. tkinter library This library provides traditional Python user interface toolkit and helps you to create user friendly GUI interface for different types of applications. Malplotlib library This library offers many functions and tools to produce quality output in variety of formats such as plots, charts, graphs
  • 4. 4 Python standard library • Some commonly used modules of Python standard library are: Library Functions math module Provides mathematical functions to support different types of calculations. cmath module provides mathematical functions for complex numbers random module provides functions for generating pseudo-random numbers statistics module provides mathematical statistics functions Urllib module provides URL handling functions so that you can access websites from within your program
  • 5. 5 What is a Module? • Python module is a file(.py file) containing variables, class definitions, statements and functions related to a particular task. • A Module, in general:  Is independent grouping of code and data  Can be re-used in other programs.  Can depend on other modules
  • 6. 6 Structure of a Python Module • A Python module can contain much more than just functions. • A Python module is a normal Python file (.py file) containing one or more of the following objects related to a particular task: • So, we can say that the module ‘ABC' means it is file ‘ABC.py’ Structure Task docstrings triple quoted comments; useful for documentation purposes. variables and constants labels for data classes templates/blueprint to create objects of a certain kind objects instances of classes. In general, objects are representation of some real or abstract entity statements Instructions for processing functions named group of instructions
  • 7. 7 Importing Modules • Python module files have an extension .py • These modules can be imported in the following ways:  import statement - to import entire module  from statement - to import selected object  from * statement - import all names from the module
  • 8. 8 IMPORTING MODULES- import • import statement is used to include the modules in other programs.  syntax : import <filename>  example: import math • more than one module can be inserted in a python program  syntax : import <filename> ,<filename>,<filename>……  example: import math,os • using import statement one can view all the functions and other attributes of a particular module  example: import math dir(math)
  • 9. 9 IMPORTING MODULES- from • importing module can be done using from statement specific attributes can be included in other programs. • syntax : • from <filename> import function name • example: • from math import math.sqrt
  • 10. 10 IMPORTING MODULES- from* • from* statement can be used to import all names from the module in to the current calling name space. • syntax : from <filename> import * • example: from math import * math.sqrt(4) • we can access any function by using dot notation.
  • 11. 11 NAMESPACES When we import modules in a particular program these modules will become part of that program and are called as namespace. Python implements namespaces in the form of dictionaries. It maintains a name to object mapping. There are three types of namespaces 1) Global 2) Local 3) Built in Namespaces
  • 12. 12 MODULE ALIASING • One can create an alias while importing module in a program • Syntax: import <filename> as <alias name> • Example: import math as m m.sqrt(4) • Like module aliasing members are also aliased • syntax: import <filename> as <alias name>,member as alias name • Example: import test as t, add as sum test.py is module file and is referred to as t and add is the function, it is referred to as sum.
  • 13. 13 PACKAGE/LIBRARY • Python packages are the collection of related modules. You can import a package or create your own. • Python package is a simply directory of python modules • Steps to create and import a package 1. create a directory named ‘Gemetry’ 2. add modules area.py and volume.py 3. create a file __init__.py in directory ‘Geometry’. The __init__.py files are required to make python treat the directory as containing package
  • 14. 14 PACKAGE/LIBRARY • What is __init__.py file? • __init__.py is simply a file used to consider directories on the disk as package of python. • It is basically used to initilize the python package • Python searches module in the following manner • 1) Searches in current directory • 2) If the module is not found then searches each directory in the shell variable PYTHONPATH • 3) If all else fails, python checks the default path which is the installation location of the python
  • 15. 15 pip • What is pip? • pip is a package-management system used to install and manage software packages written in Python. • To check pip version run, pip --version at dos prompt
  • 16. 16 • We learned about the Python Library . • Types of Libraries • Modules in Python • Packages in Python. • We also looked at the creating PACKAGE/LIBRARY. Thank you Conclusion!