Python Programming Unit -1.

Slides:



Advertisements
Similar presentations
Python By Steve Wright. What is Python? Simple, powerful, GP scripting language Simple, powerful, GP scripting language Object oriented Object oriented.
Advertisements

Python Brandon Jeffcoat Dashaun West “Why settle for snake oil when you can have the whole snake?” -- From Usenet posting by Mark Jackson, June 1998.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Mgt 240 Lecture Website Construction: Software and Language Alternatives March 29, 2005.
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
Python Introduction.
Section 6.1 Explain the development of operating systems Differentiate between operating systems Section 6.2 Demonstrate knowledge of basic GUI components.
CSC 110 A 1 CSC 110 Introduction to Python [Reading: chapter 1]
INTRODUCTION TO WEB DATABASE PROGRAMMING
Ch 1. Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Chapter Lead Black Slide Powered by DeSiaMore Powered by DeSiaMore.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
CIM6400 CTNW (04/05) 1 CIM6400 CTNW Lesson 6 – More on Windows 2000.
Computer Science 111 Fundamentals of Programming I Overview of Programming.
M1G Introduction to Database Development 6. Building Applications.
Chapter 4 System Software. Software Programs that tell a computer what to do and how to do it. Sets of instructions telling computers to perform actions.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
PHP Features. Features Clean syntax. Object-oriented fundamentals. An extensible architecture that encourages innovation. Support for both current and.
Lead Black Slide. © 2001 Business & Information Systems 2/e2 Chapter 5 Information System Software.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Introduction  Program: Set of sequence instruction that tell the computer what to do.  Software: A collection of programs, data, and information. 
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
MILESTONES IN SOFTWARE
Computer System Structures
2nd year Computer Science & Engineer
Web Programming Language
Fundamentals of Programming I Overview of Programming
Introduction to Perl: Practical extraction and report language
Top 8 Best Programming Languages To Learn
CST 1101 Problem Solving Using Computers
NOCTI Study Guide #2.
File System Implementation
Software Mr. Singh.
Topics Introduction Hardware and Software How Computers Store Data
PERL.
E-commerce | WWW World Wide Web - Concepts
Ch 1. A Python Q&A Session Bernard Chen 2007.
Platform as a Service.
E-commerce | WWW World Wide Web - Concepts
Course: Introduction to Computers
CO6025 Advanced Programming
PHP / MySQL Introduction
Computer Technology Notes #3
Chapter 2: Operating-System Structures
Do you know this browser?...
What Is a Program? A program is like an algorithm, but describes a process that is ready or can be made ready to run on a real computer Retrieved from:
Introduction to Python
Chapter 27 WWW and HTTP.
Chapter 6 System and Application Software
Chapter 2: System Structures
Topics Introduction Hardware and Software How Computers Store Data
Intro to PHP.
Chapter 2: Operating-System Structures
12th Computer Science – Unit 5
Chapter 1: Programming Basics, Python History and Program Components
Chapter 6 System and Application Software
Chapter 6 System and Application Software
Chapter 6 System and Application Software
Web Application Development Using PHP
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Python Programming Unit -1

History of Python Python was created by Guido Van Rossum, who was a Dutch person from Netherlands in the Year 1991. Guideo Van Rossum created it when he was working in National Research Institute of Mathemetics and Computer Science (NRIM&CS) in Netherlands. He thought to create a scripting language as a “Hobby” in Christmas break in 1980. He studied all the languages like ABC (All Basic Code), C, C++, Modula-3, Smalltalk, Algol-68 and Unix Shell and collected best features. He stared implementing it from 1989 and finished and released first working version of Python in 1991. He named it as “Python”,being a big fan of “Monty Python’s Flying Circus” comedy show broadcasted in BBC from 1969 to 1974.

Version History Python 1.0 (1994) Python 2.0 (2000) Python 3.0 (2008) Python 2.7 (2010) -Currently we are using this version Python 3.0 (2008) Python 3.1(2009) Python 3.2(2011) Python 3.3 (2012) Python 3.4(2014) Note: Python 3.0 was designed to rectify the problems in the older versions. It has lot many new features when compared to python.

Need of Python Programming The following are the factors to use Python Software quality - Python code is designed to be readable, and hence reusable and maintainable Developer productivity - Python boosts developer productivity many times beyond compiled or statically typed languages such as C, C++, and Java. Python code is typically one-third to one-fifth the size of equivalent C, C++ and Java Programs. Program portability - Most Python programs run unchanged on all major computer platforms. Porting Python code between Linux, Windows, and Mac. Support libraries- Python comes with a large collection of prebuilt and portable functionality, known as the standard library. This library supports an array of application-level programming tasks, from text pattern matching to network scripting. Component integration - Python scripts can easily communicate with other parts of an application, using a variety of integration mechanisms. Such integrations allow Python to be used as a product customization and extension tool. Today, Python code can invoke C and C++ libraries. Enjoyment- It is easy to use. It gives programmer flexibility to write programs.

Applications of Python Python’s most common applications are as follow: Systems Programming: Python’s built-in interfaces to operating- system services make it ideal for writing portable, maintainable system-administration tools and utilities (sometimes called shell tools). Python programs can search files and directory trees, launch other programs, do parallel processing with processes and threads, and so on.   GUIs: Python’s simplicity and rapid turnaround also make it a good match for graphical user interface programming on the desktop. Python comes with a standard object-oriented interface to the Tk GUI API called tkinter (Tkinter in 2.X) that allows Python programs to implement portable GUIs with a native look and feel. Python/tkinter GUIs run un-changed on Microsoft Windows, X Windows (on Unix and Linux), and the Mac OS (both Classic and OS X).

Internet Scripting: Python comes with standard Internet modules that allow Python programs to perform a wide variety of networking tasks, in client and server modes. Scripts can communicate over sockets, extract form information sent to server-side CGI(common gateway interface) scripts, transfer files by FTP(file transfer protocol), parse and generate XML and JSON documents, send, receive, compose, and parse email, and fetch web pages by URLs(uniform resource locator).   Component Integration: Python scripts can easily communicate with other parts of an application, using a variety of integration mechanisms. Such integrations allow Python to be used as a product customization and extension tool. Today, Python code can invoke C and C++ libraries.

Database Programming: For traditional database demands, there are Python interfaces to all commonly used relational database systems—Sybase, Oracle, Informix, ODBC, MySQL, PostgreSQL, SQLite, and more. The Python world has also defined a portable database API for accessing SQL database systems from Python scripts, which looks the same on a variety of underlying database systems.   Rapid Prototyping: To Python programs, components written in Python and C look the same. Because of this, it’s possible to prototype systems in Python initially, and then move selected components to a compiled language such as C or C++ for delivery. Unlike some prototyping tools, Python doesn’t require a complete rewrite once the prototype has solidified. It increases efficiency and reduce time and cost.

Numeric and Scientific Programming: Python has a module called “NumPy” to support all numerical programming. Python also has “SciPy” to support all the scientific application. Hence python is suitable for both numeric and scientific applications.

And More: Gaming, Images, Data Mining, Robots, Excel...  Python is commonly applied in more domains than can be covered here. For example, you’ll find tools that allow you to use Python to do: Image processing Robot control programming Natural language analysis Web Development Data Analysis Machine Learning Artificial Intelligence

Basics of Python Programming Using the REPL(Shell) We can Run Python Script in Three ways Using the Interactive Interpreter Using the GUI Invoking the Interpreter using the Command Prompt

Variable Variable is the name given to the value that is stored in the memory of the computer. Ex: X=5 Variable has naming rules

Assignment Operator It is used to create a variable and make it reference to a value in the memory Variable name is written to the left of =, and value is written to the right of =

Keywords These are the reserved words, we should not use them as varibles in the program To know the list of keywords Type the following at interpreter Import keyword Print (keyword.kwlist)

Input and out put Operations I/P operation :Reading the data from keyboard ,file and other devices We have two function raw_input() Input() O/P operation: Reading the data to screen ,file and other devices. We have one function Print ()

Indentation In python, each line of the block must be indented. We have two ways to indent line Spaces Tabs

End of Unit 1