Slideshare.net (beta)

 
Post: 
Myspace Hi5 Friendster Xanga LiveJournal Facebook Blogger Tagged Typepad Freewebs BlackPlanet gigya icons



All comments

Add a comment on Slide 1

If you have a SlideShare account, login to comment; else you can comment as a guest


Showing 1-50 of 0 (more)

Introduction to Python

From amaneiro, 5 months ago

312 views  |  0 comments  |  0 favorites  |  20 downloads
 
 
 

Groups/Events

Not added to any group/event

 
 

Privacy InfoNew!

This slideshow is Public

 
CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License
Embed in your blog
Embed (wordpress.com)
custom

Slideshow Statistics
Total Views: 312
on Slideshare: 312
from embeds: 0* * Views from embeds since 21 Aug, 07

Slideshow transcript

Slide 1: Python Session 1: introduction to Python José Dapena Paz <jdapena@igalia.com>

Slide 2: Sessions ● Session 1: – Presentation of language, brief history and practical examples of language structures. ● Session 2: – Important projects – Standard libraries – Other modules

Slide 3: First session contents ● ¿What's Python? – Brief history – Properties – Documentation ¿Where? ● Introduction to the language – Installation and usage – Practical examples

Slide 4: ¿What's Python? ● ¿What's Python? – Brief history – Properties – Documentation ¿Where? ● Introduction to the language – Installation and usage – Practical examples

Slide 5: ¿What's Python? ● High level language ● Author: Guido Van Rossum (first release in 1991) ● Emphasis on readability. ● Priority: easy for programmer, then, computer. ● Minimalist language. Wide libraries.

Slide 6: History ● Author: Guido Van Rossum. CWI. ● Begins Python at the end of 80's. Inspired in ABC language. ● First release in 1991. ● Guido Van Rossum: Benevolent Dictator For Life

Slide 7: Cronology ● 1991: 1st release. Classes, inheritance, exceptions, modules and basic types list, dict y str ● 1994: 1.0. Basic functional programming (lambda methods). ● 2001: 1.6.1 y 2.1. GPL compatible license. ● Python 2.2. All types are unified. All are classes. ● Futurr: Python 3000 (3.0) in 2008.

Slide 8: Python is free software ● From Python 2.2, Python Foundation Software License, GPL-compatible. ● All code is property of Python Foundation. ● Python community show a very high activity: – Hundreds of modules/extensions available. – Lots of software available implemented in Python. – Python is the language of 2007 (language TIOBE, Python had biggest increase of usage).

Slide 9: Documentation ● Python is very well documented http://docs.python.org ● Tutorial: http://docs.python.org/tut/ ● Language reference: (for language lawyers): http://docs.python.org/ref/ ● Library reference: http://docs.python.org/lib/

Slide 10: First session contents ● ¿What's Python? – Brief history – Properties – Documentation ¿Where? ● Introduction to the language – Installation and usage – Practical examples

Slide 11: Installation and running In ubuntu, install Python package: $ sudo apt-get install python Very useful to install online documentation: $ sudo apt-get install python-doc

Slide 12: Python shell ● Python is an interpreted language. ● Modes: – Interactive – File – Command line – Executable

Slide 13: Modo interactivo Just run Python, and add commands and statements in the shell $ python Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 1+1 2 >>> a = ”hola” >>> a 'hola' >>> print a hola

Slide 14: Shell mode help Whith dir () command we get the methods available. >>> dir (a) # With instances >>> dir (list) # With classes With help () command we get the help of a class or instance. >>> help (a) # With instances (no strings) >>> help (list) # With classes

Slide 15: Python as a calculator ● Basic types: – Integers – Floats and complex numbers – Strings ● Asign ● _ variable ● Lists. Ranges, asigns by range, operators.

Slide 16: Control flow structures ● While. Indentation in Python ● If, If-Elif-Else ● For, range. ● Break, continue, else, pass ● Functions. Definition. ● Classes

Slide 17: More flow control structures ● List methods. The list as a queue and as a stack. ● Map, reduce, filter ● List comprehensions ● Del ● Other sequences: tuples. Dictionaries ● Looping ● Conditions, conditions in sequences.

Slide 18: Modules ● Modules reference ● Examples: Files api (File objects), http api (urllib2)