http://www.skillbrew.com
/Skillbrew
Talent brewed by the
industry itself
Python interpreter and files
Pavan Verma
@YinYangPavan
Founder, P3 InfoTech Solutions Pvt. Ltd.
1
Python Programming Essentials
© SkillBrew http://skillbrew.com
Interpreter
 An interpreter is a computer program
which executes other programs.
 Python interpreter carries out
instructions in your program.
 Python interpreter can be used
interactively to test out instructions on
the fly. A good way to try little
experiments.
2
© SkillBrew http://skillbrew.com
>>> 'hey' * 2
'heyhey'
>>> 2 + 2
4
>>> 9/2
4
>>> 9//2
4
>>> colors = ['orange', 'red',
'yellow']
>>> colors
['orange', 'red', 'yellow']
>>> for color in colors:
color
'orange'
'red'
'yellow'
Try things in interpreter
and it will give back
results immediately. No
need to write separate
programs to learn new
features.
3
© SkillBrew http://skillbrew.com
pyc files
.pyc files are "Compiled" Python files”. Once a file is
compiled, Python executes the compiled file.
.pyc files are created when the .py file’s modification
time is different.
It’s good to keep .pyc files around, speeds up execution
when a program is ran again by avoiding compilation.
Python
File
*.py
Bytecode
*.pyc
Interpreter
uses *.pyc
file
4
© SkillBrew http://skillbrew.com
A look under the hood
 The python interpreter consists of two parts:
• A python bytecode compiler
• A virtual machine which executes Python
bytecode.
Source:
http://trizpug.org/Members/cbc/
wyntkap/compiler.html 5
© SkillBrew http://skillbrew.com
A look under the hood (2)
• The bytecode compiler accept human
readable python expressions and statements
as input.
• And produces machine-readable python
bytecode as output.
Source:
http://trizpug.org/Members/cbc/
wyntkap/compiler.html 6
© SkillBrew http://skillbrew.com
A look under the hood (3)
• The virtual machine accepts the python
bytecode as input.
• And executes the virtual machine
instructions represented by the bytecode.
Source:
http://trizpug.org/Members/cbc/
wyntkap/compiler.html 7
© SkillBrew http://skillbrew.com
Resources
 http://trizpug.org/Members/cbc/wyntka
p/compiler.html
8

More Related Content

PPSX
Type conversion
PPTX
File handling in c++
PDF
Datatypes in python
PPT
Binary operator overloading
PPTX
Unit 6. Arrays
PPTX
Python built in functions
PPT
1.python interpreter and interactive mode
Type conversion
File handling in c++
Datatypes in python
Binary operator overloading
Unit 6. Arrays
Python built in functions
1.python interpreter and interactive mode

What's hot (20)

PDF
PPT
Chapter 13 - Recursion
PPSX
Files in c++
PDF
Java Presentation For Syntax
PPTX
Constructor overloading & method overloading
PPTX
PPTX
STRINGS IN PYTHON
PPTX
Bitwise operators
PPTX
Operators in java
PPTX
Understand more about C
PPTX
Stream classes in C++
PPTX
Values and Data types in python
PPSX
Modules and packages in python
PPT
14 file handling
 
PPTX
Java literals
PPTX
Recursion
PDF
Python programming : Control statements
PPTX
Iostream in c++
PPTX
computer science JAVA ppt
Chapter 13 - Recursion
Files in c++
Java Presentation For Syntax
Constructor overloading & method overloading
STRINGS IN PYTHON
Bitwise operators
Operators in java
Understand more about C
Stream classes in C++
Values and Data types in python
Modules and packages in python
14 file handling
 
Java literals
Recursion
Python programming : Control statements
Iostream in c++
computer science JAVA ppt
Ad

Viewers also liked (14)

PPT
Introduction to Python
PPTX
Python Programming Essentials - M2 - Introduction to Python
PPTX
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
PPTX
Python Programming Essentials - M25 - os and sys modules
PPTX
Python Programming Essentials - M35 - Iterators & Generators
PPTX
Python Programming Essentials - M39 - Unit Testing
PPTX
Python Programming Essentials - M28 - Debugging with pdb
PPTX
Python Programming Essentials - M40 - Invoking External Programs
PPTX
Python Programming Essentials - M31 - PEP 8
PPTX
Python Programming Essentials - M34 - List Comprehensions
PPTX
Python Programming Essentials - M5 - Variables
PPTX
Python Programming Essentials - M44 - Overview of Web Development
PPTX
Python Programming Essentials - M27 - Logging module
PDF
Scalable web application architecture
Introduction to Python
Python Programming Essentials - M2 - Introduction to Python
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
Python Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M39 - Unit Testing
Python Programming Essentials - M28 - Debugging with pdb
Python Programming Essentials - M40 - Invoking External Programs
Python Programming Essentials - M31 - PEP 8
Python Programming Essentials - M34 - List Comprehensions
Python Programming Essentials - M5 - Variables
Python Programming Essentials - M44 - Overview of Web Development
Python Programming Essentials - M27 - Logging module
Scalable web application architecture
Ad

Similar to Python Programming Essentials - M29 - Python Interpreter and Files (20)

PDF
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
PDF
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
PPTX
MODULE 1.pptx
PPTX
Module1-Chapter1_ppt.pptx
PPTX
Introducing-the-Python-Interpreter. What is Python Interpreter
PDF
Python_Programming_PPT Basics of python programming language
PPTX
Python Lecture 1
PPT
Py-Slides-1.ppt1234444444444444444444444444444444444444444
PPT
program on python what is python where it was started by whom started
PPT
Python slides for the beginners to learn
PPT
Python Over View (Python for mobile app Devt)1.ppt
PPT
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
PPTX
Introduction to python.pptx
PPTX
Chapter 2: Basics of programming pyton programming
PPTX
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
PDF
problem solving and python programming UNIT 2.pdf
PDF
Problem Solving and Python Programming UNIT 2.pdf
PDF
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
PPT
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
PDF
Python Programing Bio computing,basic concepts lab,,
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
MODULE 1.pptx
Module1-Chapter1_ppt.pptx
Introducing-the-Python-Interpreter. What is Python Interpreter
Python_Programming_PPT Basics of python programming language
Python Lecture 1
Py-Slides-1.ppt1234444444444444444444444444444444444444444
program on python what is python where it was started by whom started
Python slides for the beginners to learn
Python Over View (Python for mobile app Devt)1.ppt
Py-Slides-1.pptPy-Slides-1.pptPy-Slides-1.pptPy-Slides-1.ppt
Introduction to python.pptx
Chapter 2: Basics of programming pyton programming
Python Mastery: A Comprehensive Guide to Setting Up Your Development Environment
problem solving and python programming UNIT 2.pdf
Problem Solving and Python Programming UNIT 2.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
Python Programing Bio computing,basic concepts lab,,

More from P3 InfoTech Solutions Pvt. Ltd. (19)

PPTX
Python Programming Essentials - M24 - math module
PPTX
Python Programming Essentials - M23 - datetime module
PPTX
Python Programming Essentials - M22 - File Operations
PPTX
Python Programming Essentials - M21 - Exception Handling
PPTX
Python Programming Essentials - M20 - Classes and Objects
PPTX
Python Programming Essentials - M19 - Namespaces, Global Variables and Docstr...
PPTX
Python Programming Essentials - M18 - Modules and Packages
PPTX
Python Programming Essentials - M17 - Functions
PPTX
Python Programming Essentials - M16 - Control Flow Statements and Loops
PPTX
Python Programming Essentials - M15 - References
PPTX
Python Programming Essentials - M14 - Dictionaries
PPTX
Python Programming Essentials - M13 - Tuples
PPTX
Python Programming Essentials - M12 - Lists
PPTX
Python Programming Essentials - M11 - Comparison and Logical Operators
PPTX
Python Programming Essentials - M10 - Numbers and Artihmetic Operators
PPTX
Python Programming Essentials - M9 - String Formatting
PPTX
Python Programming Essentials - M8 - String Methods
PPTX
Python Programming Essentials - M7 - Strings
PPTX
Python Programming Essentials - M6 - Code Blocks and Indentation
Python Programming Essentials - M24 - math module
Python Programming Essentials - M23 - datetime module
Python Programming Essentials - M22 - File Operations
Python Programming Essentials - M21 - Exception Handling
Python Programming Essentials - M20 - Classes and Objects
Python Programming Essentials - M19 - Namespaces, Global Variables and Docstr...
Python Programming Essentials - M18 - Modules and Packages
Python Programming Essentials - M17 - Functions
Python Programming Essentials - M16 - Control Flow Statements and Loops
Python Programming Essentials - M15 - References
Python Programming Essentials - M14 - Dictionaries
Python Programming Essentials - M13 - Tuples
Python Programming Essentials - M12 - Lists
Python Programming Essentials - M11 - Comparison and Logical Operators
Python Programming Essentials - M10 - Numbers and Artihmetic Operators
Python Programming Essentials - M9 - String Formatting
Python Programming Essentials - M8 - String Methods
Python Programming Essentials - M7 - Strings
Python Programming Essentials - M6 - Code Blocks and Indentation

Python Programming Essentials - M29 - Python Interpreter and Files