Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Python 101

100 views

Published on

Charla introductoria de Python para programadores que no conocen el lenguaje.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Python 101

  1. 1. PYTHON 101 Julián Perelli @jperelli Cualbondi Mainstorconcept Docente UTN FRLP
  2. 2. Historia
  3. 3. Guido van Rossum Python's Benevolent Dictator for Life “In December 1989, I was looking for a "hobby" programming project that would keep me occupied during the week around Christmas”
  4. 4. Guido van Rossum “I decided to write an interpreter for the new scripting language I had been thinking about lately: a descendant of ABC that would appeal to Unix/C hackers.”
  5. 5. Guido van Rossum ● CWI, Centrum Wiskunde & Informatica ● Google ● Dropbox
  6. 6. Monty python
  7. 7. Filosofía
  8. 8. The zen of python Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea.
  9. 9. The zen of python Beautiful is better than ugly. Simple is better than complex. Flat is better than nested. Readability counts.
  10. 10. Fanatismo Premature optimization vs clarity Pythonic Pythonista
  11. 11. Features
  12. 12. Multiparadigma (Propósito general) Imperativo + procedural Orientado a Objetos Funcional - map / reduce / filter /comprehensions / generators
  13. 13. Features Tipado dinámico - No se declaran variables - Las variables pueden cambiar de tipo en tiempo de ejecución Garbage collector Full unicode (utf8) support
  14. 14. Sintaxis
  15. 15. Sintaxis: Expresiones a = 1 b = a + 2 a = “Hola” b = “ Mundo” print a + b
  16. 16. Sintaxis: Convenciones
  17. 17. Sintaxis: Convenciones if (condition) { /* statements */ } if (condition) { /* statements */ } if (condition) { /* statements */ } if (condition) { if (condition){ /* statements */ } if (condition) { /* statements */ } if (condition) { /* statements */ } if (condition) {/* statements if (condition){
  18. 18. Sintaxis: Convenciones Tabs vs Espacios
  19. 19. Sintaxis: Convenciones Tabs vs Espacios
  20. 20. Sintaxis: Control if a < b: print “a es” print “menor” else: print “a es mayor o igual”
  21. 21. Sintaxis: Loop for e in [1, 5, “pepe”]: print e
  22. 22. Sintaxis void bubble_sort (int *a, int n) { int i, t, s = 1; while (s) { s = 0; for (i = 1; i < n; i++) { if (a[i] < a[i - 1]) { t = a[i]; a[i] = a[i - 1]; a[i - 1] = t; s = 1; } } } } def bubble_sort(a): s = True while s: s = False for i in xrange(len(a) - 1): if a[i] > a[i+1]: a[i], a[i+1] = a[i+1], a[i] s = True return None
  23. 23. Sintaxis void bubble_sort (int *a, int n) { int i, t, s = 1; while (s) { s = 0; for (i = 1; i < n; i++) { if (a[i] < a[i - 1]) { t = a[i]; a[i] = a[i - 1]; a[i - 1] = t; s = 1; } } } } def bubble_sort(a): s = True while s: s = False for i in xrange(len(a) - 1): if a[i] > a[i+1]: a[i], a[i+1] = a[i+1], a[i] s = True return None
  24. 24. Sintaxis ofuscada void bubble_sort (int *a, int n) {int i, t, s = 1;while (s) {s = 0; for (i = 1; i < n; i++) {if (a[i] < a[i - 1]) {t = a[i];a[i] = a[i - 1];a[i - 1] = t;s = 1;}}}} def bubble_sort(a): s = True while s: s = False for i in xrange(len(a) - 1): if a[i] > a[i+1]: a[i], a[i+1] = a[i+1], a[i] s = True return None
  25. 25. Comunidad
  26. 26. Comunidad: Paquetes Pypi pip install paquete
  27. 27. Comunidad: Paquetes
  28. 28. Me voy a node.js?
  29. 29. Me voy a node.js? NO Diferentes propósitos Node's early packaging
  30. 30. Comunidad: Github
  31. 31. Quién lo usa Infraestructura (scripting linux) Web sites Math experts Standalone PC apps
  32. 32. Quien lo usa
  33. 33. Quien no lo usa?
  34. 34. Quien no lo usa? ¿Qué esperás?
  35. 35. Gracias!

×