This document discusses Python libraries and modules. It defines a library as a collection of modules that provide specific functionality. The standard library contains commonly used modules like math and random. Other important libraries mentioned are NumPy, SciPy, and tkinter. A module is a .py file that contains related variables, classes, functions etc. Modules can be imported using import, from, or from * statements. Namespaces and module aliasing are also covered. The document concludes by explaining how to create Python packages and the role of the __init__.py file in making a directory a package.
A class is a code template for creating objects. Objects have member variables and have behaviour associated with them. In python a class is created by the keyword class.
An object is created using the constructor of the class. This object will then be called the instance of the class.
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAMaulik Borsaniya
Classes and Object-oriented Programming:
Classes: Creating a Class, The Self Variable, Constructor, Types of Variables, Namespaces, Types of Methods (Instance Methods, Class Methods, Static Methods), Passing Members of One Class to Another Class, Inner Classes
Inheritance and Polymorphism: Constructors in Inheritance, Overriding Super Class Constructors and Methods, The super() Method, Types of Inheritance, Single Inheritance, Multiple Inheritance, Method Resolution Order (MRO), Polymorphism, Duck Typing Philosophy of Python, Operator Overloading, Method Overloading, Method Overriding
Abstract Classes and Interfaces: Abstract Method and Abstract Class, Interfaces in Python, Abstract Classes vs. Interfaces,
A class is a code template for creating objects. Objects have member variables and have behaviour associated with them. In python a class is created by the keyword class.
An object is created using the constructor of the class. This object will then be called the instance of the class.
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAMaulik Borsaniya
Classes and Object-oriented Programming:
Classes: Creating a Class, The Self Variable, Constructor, Types of Variables, Namespaces, Types of Methods (Instance Methods, Class Methods, Static Methods), Passing Members of One Class to Another Class, Inner Classes
Inheritance and Polymorphism: Constructors in Inheritance, Overriding Super Class Constructors and Methods, The super() Method, Types of Inheritance, Single Inheritance, Multiple Inheritance, Method Resolution Order (MRO), Polymorphism, Duck Typing Philosophy of Python, Operator Overloading, Method Overloading, Method Overriding
Abstract Classes and Interfaces: Abstract Method and Abstract Class, Interfaces in Python, Abstract Classes vs. Interfaces,
Analysis of data in Python with SciPy and pandas, Ubuntu installation, PyCharm configuration, Series, DataFrame, big data, medical data, merging data, groupby, graphing data, iPython using Wakari.io, and analyzing stock prices of US automakers including Ford and Telsa. As presented at Penguicon 2016.
This is the basic introduction of the pandas library, you can use it for teaching this library for machine learning introduction. This slide will be able to help to understand the basics of pandas to the students with no coding background.
The tutorial will introduce you to Python Packages. This Python basic tutorial will help you understand creating a Python package. You will understand the example of a Python Package. After that, you will understand different ways to access Python Packages. Further, the demonstration will educate you on how to create Python Package.
( ** Python Certification Training: https://www.edureka.co/python ** )
This Edureka PPT on Tkinter tutorial covers all the basic aspects of creating and making use of your own simple Graphical User Interface (GUI) using Python. It establishes all of the concepts needed to get started with building your own user interfaces while coding in Python.
YouTube Link: https://youtu.be/7GXaobCrBb4
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Python Modules' will help you understand the concept of modules in python, why and how we can use modules in python. Below are the topics covered in this PPT:
What Is A Python Module?
How To Create A Python Module?
How To Call A Python Module?
Built-in Modules In Python
Demo
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This presentation educates you about objectives of python with example syntax, OOP Terminology, Creating Classes, Creating Instance Objects, Accessing Attributes and Built-In Class Attributes.
This presentation deals with pure object oriented concepts and defines basic principles of OOP's like Encapsulation , polymorphism , Inheritance and Abstraction.
Object oriented programming with pythonArslan Arshad
A short intro to how Object Oriented Paradigm work in Python Programming language. This presentation created for beginner like bachelor student of Computer Science.
Analysis of data in Python with SciPy and pandas, Ubuntu installation, PyCharm configuration, Series, DataFrame, big data, medical data, merging data, groupby, graphing data, iPython using Wakari.io, and analyzing stock prices of US automakers including Ford and Telsa. As presented at Penguicon 2016.
This is the basic introduction of the pandas library, you can use it for teaching this library for machine learning introduction. This slide will be able to help to understand the basics of pandas to the students with no coding background.
The tutorial will introduce you to Python Packages. This Python basic tutorial will help you understand creating a Python package. You will understand the example of a Python Package. After that, you will understand different ways to access Python Packages. Further, the demonstration will educate you on how to create Python Package.
( ** Python Certification Training: https://www.edureka.co/python ** )
This Edureka PPT on Tkinter tutorial covers all the basic aspects of creating and making use of your own simple Graphical User Interface (GUI) using Python. It establishes all of the concepts needed to get started with building your own user interfaces while coding in Python.
YouTube Link: https://youtu.be/7GXaobCrBb4
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Python Modules' will help you understand the concept of modules in python, why and how we can use modules in python. Below are the topics covered in this PPT:
What Is A Python Module?
How To Create A Python Module?
How To Call A Python Module?
Built-in Modules In Python
Demo
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This presentation educates you about objectives of python with example syntax, OOP Terminology, Creating Classes, Creating Instance Objects, Accessing Attributes and Built-In Class Attributes.
This presentation deals with pure object oriented concepts and defines basic principles of OOP's like Encapsulation , polymorphism , Inheritance and Abstraction.
Object oriented programming with pythonArslan Arshad
A short intro to how Object Oriented Paradigm work in Python Programming language. This presentation created for beginner like bachelor student of Computer Science.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
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!