0% found this document useful (0 votes)
135 views18 pages

Python Day 1

This document provides an introduction and overview of the Python programming language. It discusses that Python is an interpreted, high-level and object-oriented scripting language. It also summarizes Python's history, major releases, features, popular uses cases, and how to set up the Python environment and use the interactive interpreter or write scripts.

Uploaded by

Muthu Selvan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
135 views18 pages

Python Day 1

This document provides an introduction and overview of the Python programming language. It discusses that Python is an interpreted, high-level and object-oriented scripting language. It also summarizes Python's history, major releases, features, popular uses cases, and how to set up the Python environment and use the interactive interpreter or write scripts.

Uploaded by

Muthu Selvan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 18

Introduction to Python

Premier Embedded Training centre in the country


Software Language Levels
• Machine Language (Binary)
• Assembly Language
– Assembler converts Assembly into machine
• High Level Languages (C, Java, Python)
– Compiled : C
– Interpreted : Python, Perl, Shell

Premier Embedded Training centre in the country


Complier Interpreter

Source File

Interpreter
(Intermediate
Code)

Executable
Program

Premier Embedded Training centre in the country


PYTHON

• High Level Scripting Language


• Processed at runtime by interpreter
• Object Oriented
• Provides high-level dynamic data
• Open Source with cross platform

Premier Embedded Training centre in the country


History
• Conceived in the late s
• Developed 1990 by Guido van Rossum,
Netherlands
• Derived from ABC, Modula-3, C, C++
• Open sourced from the beginning
• Used by Google from the beginning

Premier Embedded Training centre in the country


Releases
• Created in 1989 by Guido Van Rossum
• Python 1.0 released in 1994
• Python 2.0 released in 2000
• Python 3.0 released in 2008
• Python 2.7 is the recommended version
• 3.0 adoption will take a few years

Premier Embedded Training centre in the country


Python Features
• Designed to be easy to learn and master
– Clean, clear syntax
– Very few keywords
• Highly portable
– Runs almost anywhere - high end servers,
workstations, Linux and Mac OSX
• Inbuilt Variables
• GUI Programming
• Easily integrated with C, C++, Java

Premier Embedded Training centre in the country


Python Features
no compiling or linking mixed language systems
no type declarations fast development
automatic memory management run-time program construction
high-level data types and interactive, dynamic nature
operations
object-oriented programming fewer restrictions and rules
embedding and extending in C wide portability
classes, modules, exceptions system Files, GUIs, databases, etc.
Reusability simpler, shorter, more flexible

Premier Embedded Training centre in the country


Who uses Python?
1. Google
2. NASA
3. Library of congress- research library of US
4. The ONION- American digital media compay
….a d the list goes o ….

Premier Embedded Training centre in the country


Environmental Setup

• Pre-installed on most Unix systems, including


Linux and MAC OS X
• Download from http://python.org/download/
• Latest version - Python 3.6.1
• Comes with a large library of standard
modules

Premier Embedded Training centre in the country


Running Python

• Interactive Interpreter
• Script from command-line
• Integrated Development environment(IDE)

Premier Embedded Training centre in the country


Integrated Development environment(IDE)
1. PyDev with Eclipse
2. Komodo
3. Emacs
4. Vim
5. pycharm
6. Gedit
7. Idle
8. PIDA (Linux)(VIM Based)
9. NotePad++ (Windows)
10.BlueFish (Linux)

Premier Embedded Training centre in the country


Interactive Interpreter

Pytho pro pts with >>>


To exit python CTRL-D
Premier Embedded Training centre in the country
Script from command line
To make the file executable  filename.py
Then run  Python filename.py

Premier Embedded Training centre in the country


Integrated Development Environment
• Runs Python from IDE

Premier Embedded Training centre in the country


Interactive programming mode
>>> 3 + 7
• The interpreter 10
provides an interactive >>> 3 < 15
environment to play True
>>> Hello..!
with the language
Hello
• Results of expressions >>>'pri t e
are printed on the Print me
>>> print Hello..!
screen
Hello..!

Premier Embedded Training centre in the country


Interactive mode programming
Examples:
>>>Name= Pytho >>> print (50/2)
>>>print (Name) 25
Python >>>round(2.333)
>>> print (1+2+3+4) 2
10 >>> x = 3 + 2j
>>> print (15/2) >>> y = -1j
7 >>> x + y
>>> print (15.0/2) (3+1j)
7.5
Premier Embedded Training centre in the country
Script mode Programming
num1 = 10
num2 = 20
sum = num1+num2
print Su of Nu is: ,sum

•Save in .py extension (filename.py)


•Run the program

Premier Embedded Training centre in the country

You might also like