SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
Disclaimer: This presentation is prepared
by trainees of baabtra as a part of
mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System
Technologies Pvt . Ltd
Typing Speed
Week

Targ
et

Achieve
d

1

20

18

2

25

23

3

30

27

4

45

38
Jobs Applied
#

Company

Designation

Applied
Date

Current
Status

1

ioss

php developer

20/08/13

Not selected

2

nuecore

Python developer

3

Skill search limited Junior software
developer

4

butterfly

10/09/13

selected

Python developer
MODULES IN PYTHON
●

Shameena

●

shameenavayoli@gmail.com

●

www.facebook.com/shameenalatheef

●

twitter.com/shameena

●

in.linkedin.com/in/shamean

●

9567135569
What is module??
●

●

a module is a file consisting of Python
code. A module can define functions,
classes and variables. A module can also
include runnable code.
The file name containing suffix .py
def fib(n):

# write Fibonacci series up to n

a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
●
●

Save the file in fibo.py
We can use fibo.py in other program by
importing fibo.py
Example:
import fibo.py
fibo.fib(1000)
output
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610

987
●

●

●

●

●

A module can contain executable statements as well as
function definitions
They are executed only the first time the module name is
encountered in an import statement
Modules can import other modules.
Each module has its own private symbol table, which is used
as the global symbol table by all functions defined in the
module.
The author of a module can use global variables in the
module without worrying about accidental clashes with a
user’s global variables.
●

There is a variant of the import statement that imports names
from a module directly into the importing module’s symbol table.
For example:
from fibo import fib, fib2
Fib(500)
Output:
1 1 2 3 5 8 13 21 34 55 89 144 233 377

●

There is another variant to import all names that a module
defines:
from fibo import *

●

This imports all names except those beginning with an
underscore (_).
●

●

Each module is only imported once per interpreter session if
you change your modules, you must restart the interpreter or
if it’s just one module you want to test interactively, use
reload()
Eg: reload(modulename).
The Module Search Path
When a module named spam is imported, the interpreter first
searches for a built-in module with that name. If not found, it
then searches for a file named spam.py in a list of directories
given by the variable sys.path.

“Compiled” Python files
●

●

If a file called spam.pyc exists in the directory where
spam.py is found
Thanks...
If this presentation helped you, please
visit our page facebook.com/baabtra and
like it.

Thanks in advance. 
 
www.baabtra.com | www.massbaab.com |
www.baabte.com
Contact Us
Emarald Mall (Big
Bazar Building)
Mavoor Road,
Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25
550

Start up Village
Eranakulam,
Kerala, India.
Email:
info@baabtra.com

NC Complex,
Near Bus
Stand
Mukkam,
Kozhikode,
Kerala, India.
Ph: + 91 –
495 40 25
550

Más contenido relacionado

Destacado

Destacado (20)

What is Python?
What is Python?What is Python?
What is Python?
 
XML
XMLXML
XML
 
MIS
MISMIS
MIS
 
Html tags
Html tagsHtml tags
Html tags
 
XML
XMLXML
XML
 
Java exeception handling
Java exeception handlingJava exeception handling
Java exeception handling
 
Flowchart& algorithom
Flowchart& algorithomFlowchart& algorithom
Flowchart& algorithom
 
Dependent selection box using codeigniter ajax
Dependent selection box using codeigniter ajaxDependent selection box using codeigniter ajax
Dependent selection box using codeigniter ajax
 
Claas diagram
Claas diagramClaas diagram
Claas diagram
 
how to prepare for an interview
how to prepare for an interviewhow to prepare for an interview
how to prepare for an interview
 
Transaction
TransactionTransaction
Transaction
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Scope of variable
Scope of variableScope of variable
Scope of variable
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
Baabtra.com little coder chapter - 5
Baabtra.com little coder   chapter - 5Baabtra.com little coder   chapter - 5
Baabtra.com little coder chapter - 5
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Bill gates and his contributions to world
Bill gates and his contributions to worldBill gates and his contributions to world
Bill gates and his contributions to world
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
System software and Application software
System software and Application softwareSystem software and Application software
System software and Application software
 

Similar a Modules in Python

Modules 101
Modules 101Modules 101
Modules 101gjcross
 
python interview prep question , 52 questions
python interview prep question , 52 questionspython interview prep question , 52 questions
python interview prep question , 52 questionsgokul174578
 
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.pptxSingamvineela
 
Functions_in_Python.pptx
Functions_in_Python.pptxFunctions_in_Python.pptx
Functions_in_Python.pptxkrushnaraj1
 
Python Version 3.7
Python Version 3.7Python Version 3.7
Python Version 3.7Mobiloitte
 
The New York Times: Sustainable Systems, Powered by Python
The New York Times: Sustainable Systems, Powered by PythonThe New York Times: Sustainable Systems, Powered by Python
The New York Times: Sustainable Systems, Powered by PythonAll Things Open
 
Python import mechanism
Python import mechanismPython import mechanism
Python import mechanismYuki Nishiwaki
 
How to Create Manifest File in Odoo 17 ERP
How to Create Manifest File in Odoo 17 ERPHow to Create Manifest File in Odoo 17 ERP
How to Create Manifest File in Odoo 17 ERPCeline George
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 
Lecture 2 introduction to python
Lecture 2  introduction to pythonLecture 2  introduction to python
Lecture 2 introduction to pythonalvin567
 
DIY in 5 Minutes: Testing Django App with Pytest
DIY in 5 Minutes: Testing Django App with Pytest DIY in 5 Minutes: Testing Django App with Pytest
DIY in 5 Minutes: Testing Django App with Pytest Inexture Solutions
 

Similar a Modules in Python (20)

Modules 101
Modules 101Modules 101
Modules 101
 
python interview prep question , 52 questions
python interview prep question , 52 questionspython interview prep question , 52 questions
python interview prep question , 52 questions
 
AtoM feature development
AtoM feature developmentAtoM feature development
AtoM feature development
 
Multiprocessing in python
Multiprocessing in pythonMultiprocessing in python
Multiprocessing in python
 
Pythonpresent
PythonpresentPythonpresent
Pythonpresent
 
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
 
Functions_in_Python.pptx
Functions_in_Python.pptxFunctions_in_Python.pptx
Functions_in_Python.pptx
 
Python Version 3.7
Python Version 3.7Python Version 3.7
Python Version 3.7
 
The New York Times: Sustainable Systems, Powered by Python
The New York Times: Sustainable Systems, Powered by PythonThe New York Times: Sustainable Systems, Powered by Python
The New York Times: Sustainable Systems, Powered by Python
 
Python import mechanism
Python import mechanismPython import mechanism
Python import mechanism
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
PHYTON-REPORT.pdf
PHYTON-REPORT.pdfPHYTON-REPORT.pdf
PHYTON-REPORT.pdf
 
How to Create Manifest File in Odoo 17 ERP
How to Create Manifest File in Odoo 17 ERPHow to Create Manifest File in Odoo 17 ERP
How to Create Manifest File in Odoo 17 ERP
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Lecture 2 introduction to python
Lecture 2  introduction to pythonLecture 2  introduction to python
Lecture 2 introduction to python
 
Jython
JythonJython
Jython
 
Jython-Introduction
Jython-IntroductionJython-Introduction
Jython-Introduction
 
Jython
JythonJython
Jython
 
Best practices in coding for beginners
Best practices in coding for beginnersBest practices in coding for beginners
Best practices in coding for beginners
 
DIY in 5 Minutes: Testing Django App with Pytest
DIY in 5 Minutes: Testing Django App with Pytest DIY in 5 Minutes: Testing Django App with Pytest
DIY in 5 Minutes: Testing Django App with Pytest
 

Más de baabtra.com - No. 1 supplier of quality freshers

Más de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 
Baabtra soft skills
Baabtra soft skillsBaabtra soft skills
Baabtra soft skills
 
Cell phone jammer
Cell phone jammerCell phone jammer
Cell phone jammer
 
Apple iwatches
Apple iwatchesApple iwatches
Apple iwatches
 
Driverless car
Driverless carDriverless car
Driverless car
 

Último

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - AvrilIvanti
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Último (20)

Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - Avril
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

Modules in Python

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 4. Jobs Applied # Company Designation Applied Date Current Status 1 ioss php developer 20/08/13 Not selected 2 nuecore Python developer 3 Skill search limited Junior software developer 4 butterfly 10/09/13 selected Python developer
  • 6. What is module?? ● ● a module is a file consisting of Python code. A module can define functions, classes and variables. A module can also include runnable code. The file name containing suffix .py
  • 7. def fib(n): # write Fibonacci series up to n a, b = 0, 1 while b < n: print b, a, b = b, a+b ● ● Save the file in fibo.py We can use fibo.py in other program by importing fibo.py
  • 8. Example: import fibo.py fibo.fib(1000) output 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
  • 9. ● ● ● ● ● A module can contain executable statements as well as function definitions They are executed only the first time the module name is encountered in an import statement Modules can import other modules. Each module has its own private symbol table, which is used as the global symbol table by all functions defined in the module. The author of a module can use global variables in the module without worrying about accidental clashes with a user’s global variables.
  • 10. ● There is a variant of the import statement that imports names from a module directly into the importing module’s symbol table. For example: from fibo import fib, fib2 Fib(500) Output: 1 1 2 3 5 8 13 21 34 55 89 144 233 377 ● There is another variant to import all names that a module defines: from fibo import * ● This imports all names except those beginning with an underscore (_).
  • 11. ● ● Each module is only imported once per interpreter session if you change your modules, you must restart the interpreter or if it’s just one module you want to test interactively, use reload() Eg: reload(modulename).
  • 12. The Module Search Path When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path. “Compiled” Python files ● ● If a file called spam.pyc exists in the directory where spam.py is found
  • 14.
  • 15. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance.    www.baabtra.com | www.massbaab.com | www.baabte.com
  • 16. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550