Professional Documents
Culture Documents
Session 1:
Session 2:
Important projects
Standard libraries
Other modules
irst session contents
!"hat#s Python$
%rief history
Properties
&ocumentation !"here$
Practical examples
!"hat#s Python$
What's Python?
%rief history
Properties
&ocumentation !"here$
Practical examples
!"hat#s Python$
0mphasis on readability.
=utorial: http:;;docs.python.org;tut;
!"hat#s Python$
%rief history
Properties
&ocumentation !"here$
Practical examples
Installation and running
In ubuntu, install Python pac>age:
+ery useful to install online documentation:
$ sudo apt-get install python
$ sudo apt-get install python-doc
Python shell
1odes:
Interacti(e
ile
2ommand line
0xecutable
1odo interacti(o
?ust run Python, and add commands and
statements in the shell
$ python
Python 2.5.1 (r251:54863, ct 5 2!!", 13:36:32#
$%&& 4.1.3 2!!"!'2' (prerelease# (()untu
4.1.2-16u)untu2#* on linu+2
,ype -help-, -copyright-, -credits- or -license- .or /ore
in.or/ation.
000 111
2
000 a 2 3hola3
000 a
4hola4
000 print a
hola
Shell mode help
"hith dir -/ command 9e get the methods
a(ailable.
"ith help -/ command 9e get the help of a class
or instance.
000 dir (a# 5 6ith instances
000 dir (list# 5 6ith classes
000 help (a# 5 6ith instances (no strings#
000 help (list# 5 6ith classes
Python as a calculator
%asic types:
Integers
Strings
)sign
@ (ariable
If, If:0lif:0lse
or, range.
unctions. &efinition.
2lasses
1ore flo9 control structures
5ist comprehensions
&el
5ooping
1odules reference