Python

26
H P M.Gebreel DevMix

Transcript of Python

Page 1: Python

H P

M.Gebreel

DevMix

Page 2: Python

Minute of silence

:((

All copyrights reserved for M. Gebreel(Harry Potter)

Page 3: Python

Introduction

to

All copyrights reserved for M. Gebreel(Harry Potter)

Page 4: Python

Python ??!!

what is that ??

All copyrights reserved for M. Gebreel(Harry Potter)All copyrights reserved for M. Gebreel(Harry Potter)

Page 5: Python

Is this ??!!

All copyrights reserved for M. Gebreel(Harry Potter)

Page 6: Python

I am afraid

All copyrights reserved for M. Gebreel(Harry Potter)

Page 7: Python

No absolutely no

:D :D

Page 8: Python

Simply programming language

Scripting Language

Interpreted

Object-oriented

high-level programming language

All copyrights reserved for M. Gebreel(Harry Potter)

Page 9: Python

Python

Not named after This man …...

Guido van Rossum

All copyrights reserved for M. Gebreel(Harry Potter)

Page 10: Python

All copyrights reserved for M. Gebreel(Harry Potter)

Page 11: Python

At Anyway

Why python ??

What will make me learn it ??

Or

Why I love python :D :D ??All copyrights reserved for M. Gebreel(Harry Potter)

Page 12: Python

Really love it

Page 13: Python

Python is powerful... and fast#batteries included #ur web server in 3 lines

Python plays well with others#(Jpython)Python for the Java Virtual Machine# (Ironpython)Python for .NET Python runs everywhere

Python is friendly... and easy to learn

Python is Open

Answer is here

All copyrights reserved for M. Gebreel(Harry Potter)

Page 14: Python

Hello world

Python 2.7

Print “ hello world”Python 3.1

Print (“hello world”)

All copyrights reserved for M. Gebreel(Harry Potter)

Page 15: Python

The interactive interpreter

All copyrights reserved for M. Gebreel(Harry Potter)

Page 16: Python

Data types

Strings Int bool float (only one real type) complex files

All copyrights reserved for M. Gebreel(Harry Potter)

Page 17: Python

Attention plz

Python speaks now :

Do not tire yourself by writing type of the object

I will know it by myself ;)

All copyrights reserved for M. Gebreel(Harry Potter)

Page 18: Python

Everything is an Object

>>> x = 'hello, world'>>> y = x.upper()>>> y'HELLO, WORLD!'

>>> import calendar>>> cal = calendar>>> print cal.month(2007,10)

All copyrights reserved for M. Gebreel(Harry Potter)

Page 19: Python

Unusual Suspectslong — automatic promotion from int if needed

>>> x = 1024>>> x ** 50

32733906078961418700131896968275991521

6642046043064789483291368096133796404674554883270092325904157150886684127560071009217256545885393053328527589376L All copyrights reserved for M. Gebreel(Harry Potter)

Page 20: Python

Built-in data structures

Tuples – Fixed Length(1, 2, 3, “Hello”, False)

Lists[1, 2, 4, “Hello”, False]

Dictionaries{42: “The answer”, “key”: “value”}

Setsset([“list”, “of”, “values”])

All copyrights reserved for M. Gebreel(Harry Potter)

Page 21: Python

FunctionsPython uses whitespace to determine blocks of code (please don't use tabs)

EX:def greet(person):

if person == “Tim”: print “Hello Master” else: print “Hello %s” % person

All copyrights reserved for M. Gebreel(Harry Potter)

Page 22: Python

Classes

class MyClass: """This is a docstring.""" name = "Eric" def say(self): return "My name is %s" %

self.nameinstance = MyClass()print instance.say()

All copyrights reserved for M. Gebreel(Harry Potter)

Page 23: Python

Modules

Any python file is considered a module

Modules are loaded from the PYTHONPATH

All copyrights reserved for M. Gebreel(Harry Potter)

Page 24: Python

Exceptions

Also used for flow control – StopIterationExceptions are classes, and custom

exceptions are easy to write to store extra state

informationEX:

try: # Do stuff

except Exception, e: # Do something elseAll copyrights reserved for M. Gebreel(Harry Potter)

Page 25: Python

Stop !!!!Wanna more ;)

Check Out These Links

http://docs.python.org/tut/tut.html - The Python Tutorialhttp://diveintopython.org/index.html - Dive Into Pythonhttp://www.garshol.priv.no/download/text/perl.html -

Detailed Story of One Perl Hacker's Migration to Pythonhttp://www.linuxjournal.com/article/3882 - Eric Raymond's

Detailed Story and Praise for Pythonhttp://www.pythonmagazine.com - Python Magazinehttp://www.planetpython.org - Python blog aggregation

site All copyrights reserved for M. Gebreel(Harry Potter)

Page 26: Python

Questions?

All copyrights reserved for M. Gebreel(Harry Potter)