Python
Transcript of Python
H P
M.Gebreel
DevMix
Minute of silence
:((
All copyrights reserved for M. Gebreel(Harry Potter)
Introduction
to
All copyrights reserved for M. Gebreel(Harry Potter)
Python ??!!
what is that ??
All copyrights reserved for M. Gebreel(Harry Potter)All copyrights reserved for M. Gebreel(Harry Potter)
Is this ??!!
All copyrights reserved for M. Gebreel(Harry Potter)
I am afraid
All copyrights reserved for M. Gebreel(Harry Potter)
No absolutely no
:D :D
Simply programming language
Scripting Language
Interpreted
Object-oriented
high-level programming language
All copyrights reserved for M. Gebreel(Harry Potter)
Python
Not named after This man …...
Guido van Rossum
All copyrights reserved for M. Gebreel(Harry Potter)
All copyrights reserved for M. Gebreel(Harry Potter)
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)
Really love it
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)
Hello world
Python 2.7
Print “ hello world”Python 3.1
Print (“hello world”)
All copyrights reserved for M. Gebreel(Harry Potter)
The interactive interpreter
All copyrights reserved for M. Gebreel(Harry Potter)
Data types
Strings Int bool float (only one real type) complex files
All copyrights reserved for M. Gebreel(Harry Potter)
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)
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)
Unusual Suspectslong — automatic promotion from int if needed
>>> x = 1024>>> x ** 50
32733906078961418700131896968275991521
6642046043064789483291368096133796404674554883270092325904157150886684127560071009217256545885393053328527589376L All copyrights reserved for M. Gebreel(Harry Potter)
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)
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)
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)
Modules
Any python file is considered a module
Modules are loaded from the PYTHONPATH
All copyrights reserved for M. Gebreel(Harry Potter)
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)
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)
Questions?
All copyrights reserved for M. Gebreel(Harry Potter)