python per tutti
DESCRIPTION
Talk divulgativo sul linguaggio di programmazione PythonTRANSCRIPT
![Page 1: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/1.jpg)
Python per Tutti PyPg – Perugia Python Local Users Group
Questa opera è distribuita da PyPg con licenza Creative Commons Attribuzione 3.0 Unported.
![Page 2: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/2.jpg)
Python per etimologisti
![Page 3: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/3.jpg)
Python per etimologisti
http://www.flickr.com/photos/69er/200248914/
![Page 4: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/4.jpg)
Python per etimologisti
Pythonesque vs PythonicPythons vs Pythonistas
![Page 5: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/5.jpg)
Cos'è Python
● Linguaggio di programmazione:● Alto livello e General purpose● Sintassi estremamente pulita● Multiparadigma● Tipazione dinamica● Embeddable ed Estensibile● Multipiattaforma● Diverse implementazioni del linguaggio
![Page 6: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/6.jpg)
Python per programmatori Java
● Linguaggio compilato in bytecode● In Python compilazione implicita
● Tutto è un oggetto● Libreria standard vasta e potente● Garbage collection● Introspezione● Serializzazione● Threads
![Page 7: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/7.jpg)
Python per programmatori C++
● Multiparadigma● Ereditarietà multipla● Sovraccarico degli operatori● Decine di librerie terze parti per applicazioni
GUI, rete, database, calcolo distribuito
![Page 8: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/8.jpg)
Python per programmatori C
● Trust the programmer● Don’t prevent the programmer from doing
what needs to be done.● Keep the language small and simple.● Provide only one way to do an operation.● Make it fast, even if it is not guaranteed to
be portable. (oops... :-)– Keep the spirit of C, C99 Rationale
![Page 9: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/9.jpg)
Python per programmatori.
● Tipazione forte ma dinamica● I nomi non hanno tipo, gli oggetti sì
● Niente dichiarazioni – solo istruzioni● Sintassi minimale
● Indentazione definisce i blocchi● Niente () se non strettamente necessario● In generale, poca punteggiatura
● Tutto è un oggetto di prima classe● Funzioni, classi, metodi, moduli
● Il focus è sull'alto livello
![Page 10: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/10.jpg)
The Dream Language
![Page 11: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/11.jpg)
Popolarità
Non necessariamente un linguaggio popolare è anche buono, ma un linguaggio buono deve essere popolare (P.Graham).
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
![Page 12: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/12.jpg)
Popolarità
![Page 13: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/13.jpg)
Popolarità
![Page 14: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/14.jpg)
Popolarità
![Page 15: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/15.jpg)
Fattori esterni
● Documentazione e libri● Documentazione ufficiale esaustiva ed
aggiornata● Mailing lists, gruppi di discussione, canali IRC
sia internazionali che localizzati● Decine di Tutorials online● Decine e decine di ottimi libri e manuali
sull'argomento
![Page 16: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/16.jpg)
Fattori esterni
● PSF (Python Software Foundation)● Detiene e protegge la IP (©, ®) di Python● Organizza la PyCon accollandosi gli oneri● Finanzia progetti degni di nota come Jython e
PyPy● Partecipa alla Google Summer of Code
![Page 17: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/17.jpg)
Fattori esterni
● Comunità● Python Diversity● Local User Groups● Conferenze
● Open Source - Licenza PSFL● Certificata OSI● Certificata FSF● BSD-like, molto liberale
![Page 18: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/18.jpg)
Espressività
● add x to y giving z
● z=x+y
● print 'hello, world'● print sum(x for x in range(1000) if x%3==0 or x % 5==0)
● The Zen of Python: readability counts.● Executable pseudo-code
![Page 19: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/19.jpg)
Hackability
● Clean● Facile da usare● Facile da imparare● Facile da leggere
● Dirty
![Page 20: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/20.jpg)
Programmi usa e getta
● Installato di default su tutte le distribuzioni Linux e su Mac OSX
● Shell interattiva
![Page 21: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/21.jpg)
Librerie
● Batterie incluse!● Standard Python Library
– 190+ moduli● math, sys, os, random, gzip, socket, select, urllib, ftplib, ...
– 13+ packages● compile, ctypes, email, xml, ...
● Cheeseshop– 17184 packages ad oggi (Ottobre 2011)
![Page 22: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/22.jpg)
Librerie
● Batterie terze parti● GUI
– PyQt, PyGTK, wxPython
● SQL– SqlAlchemy
● Calcolo scientifico & elaborazione dati– Numpy, SciPy, PIL, openCV, pyVTK, pyCUDA
● Giochi– PyGame, PyGLet, PyOGRE
● Web e rete– Django, Pyramid, Turbogears, Twisted
![Page 23: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/23.jpg)
Efficienza
● Efficienza != Velocità● Profilers (cProfile, profile)● Threads● Multiprocess
![Page 24: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/24.jpg)
Maturità
● 1991: prima uscita pubblica
● 1992: versione MS-DOS
● 1994: comp.lang.python
● 1996: esce “Programming Python” di M.Lutz
● 1998: Zope
● 2000: versione 2.0
● 2001: RMS says Yes! (licenza gpl-compatibile)
● Sempre 2001: nasce la PSF
● 2007: prima conferenza italiana, PyCon UNO
● 2008: esce la versione 3.0
![Page 25: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/25.jpg)
Evoluzione agile
● Python Enhancement Proposal (PEP)
![Page 26: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/26.jpg)
Evoluzione agile
● Python Enhancement Proposal (PEP)● Standard Track
– PEP100 – Unicode integration– PEP202 – List comprehension
● Informational– PEP8 – Style guidelines– PEP20 – The Zen of Python
● Process– PEP3000 – Python 3k
![Page 27: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/27.jpg)
Python per tutti
● Ottimo come primo linguaggio● Ragazzi
– Python 4 kids, Snake wrangling for kids, Invent With Python
● Adulti– How to Think Like a Computer Scientist
– A Gentle Introduction to Programming Using Python (MIT)
● Nonnetti– Artificial Intelligence: a modern approach, P.Norvig
● Ottimo come ultimo linguaggio● Nel senso che non vorrete più cambiarlo
![Page 28: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/28.jpg)
Python per tutti
● Linux, Windows, OSX, AIX● Dispositivi Embedded, Smartphones, Mac,
PC, HPC● CPython, Jython, IronPython, PyPy
![Page 29: Python per tutti](https://reader033.vdocuments.site/reader033/viewer/2022042515/547d708bb379593f2b8b52a4/html5/thumbnails/29.jpg)
import antigravity
Massimiliano Pippi@maxpippi@pyperugiahttp://www.pypg.org