0% found this document useful (0 votes)
93 views

Python-SideNotes - Module 1

Uploaded by

Varun Nakra
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

Python-SideNotes - Module 1

Uploaded by

Varun Nakra
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

A Definition of Python

An object-oriented, open-source programming language


• Inheritance, encapsulation, and polymorphism supported
• Freedom to use Python and its applications for no charge
A general-purpose language used for a wide variety of application types
• Text and numeric processing
• Operating system utilities and networking through the standard library
• GUI and web applications through third-party libraries.
Python Software Foundation (PSF) controls the copyright and development of the
language after version 2.1
• An independent nonprofit group
• Guido Van Rossum started creating the language in 1989
– Known as the Benevolent Dictator For Life (BDFL)
– Leads language development and selection of new features
Python Philosophy
Simple solutions
• Code should clearly express an idea or task
Readability
• White space and indentation to define blocks of code
• Less coding required as compared to the equivalent .NET, C++, or Java
– Decreases development and maintenance time requirements
Dynamic typing and polymorphism
• No data type declarations
• Operator and method overloading
– Operators are evaluated at runtime based on the expression type
Python Installation

DEMO
Accessing the Interpreter
Console provides a command-line interface to the interpreter
• Executes commands interactively
• Has a built-in help system
Statements are executed in the same manner as when run from a file
• Enables testing as you write
• Copy code from an editor and paste into the console
In this course, there are two interfaces to the command interpreter
• Launch the IDLE application from a taskbar button
• Launch the console from a taskbar button
The Python Interpreter
Executes Source code statements.
• Entered interactively from a console or read from a text file.
Runtime environment
Source code file:
hw.py
Hello World
Python interpreter
print "Hello World"
The Python Interpreter
Can optionally create byte code
•Byte code is machine architecture independent.
•Byte code files have .pyc extension.
Byte Code is executed by the Python Virtual Machine (PVM).
•Operating System Dependent.
Byte code file:
Source code file:
hw.py hw.pyc
Python interpreter
print "Hello World" 10011101101001

PVM

Runtime environment

Hello World

You might also like