Introducción a Python

Elena He

Yo?

Una persona del mundo

Python Barcelona

Meetups técnicos Mensuales

Dojos de programación mensuales

Sistemas operativos

Qué es Python?

Qué es Python?

  • Lenguaje de programación
  • Interpretado
  • Dinámico
  • Intuitivo
  • Elegante
  • Orientado a Objectos
  • Interactivo
  • Portable
  • Reusable
  • Escalable
  • Extensible
  • ...

Dónde se usa Python?

Bajo nivel:

   Scripts de sistemas

Alto nivel:

   Aplicaciones web y 'lo que    surja'

Consejos a la hora de escribir Python?

Tener un editor de texto decente.

  • Emacs
  • VI/VIm
  • Notepad++
  • SublimeText
  • Atom

Configurarlo para que traduzca los tabuladores por 4 espacios

Ecosistema Python

2.7.x VS 3.x

2.7 3.x
Rendimiento aceptable Más eficiente
print "hola" print("hola")
codificacion de texto Unicode by default
division entera division decimal
xrange = lazy range range lazy by default
variable loop leak no leaks

Por que Python?

Por que Python?

Vamos a empezar a tocar (y romper) COSAS!

Empecemos

Abrir una terminal.

Linux:

    Aqui hay diferentes maneras

Mac OS:

    spotlight > terminal

Windows:

    ejecutar el interprete de python de vuestro directorio de instalación

Escribir 'python' y darle a enter.

Vamos a jugar !

Hora de hacer bromas

Vamos a ver como es "Hello world" en diferentes lenguajes

ADA

Invitada de honor


with Text_To; use Text_To
  procedure hello is
    begin
    put("Hello World");
  end hello 

JavaScript

Porque si

console.log("Hello world!");

Python

El ejemplo

print("Hello World")

Ruby

Otro peso pesado

puts "Hello world"

C

Ancestro de la mayoria

#include<stdio.h>

main()
{
    printf("Hello World");
}

C#

La version de Microsoft

using System;
class Program
{
    public static void Main(string[] args)
    {
        Console.WriteLine("Hello, world!");
    }
}

Parenthesis Hell

Hijo de Lisp

(()()(()()(()()()()((()()(()(()((()((()()()((()((()()()((()((((()()(()(
)()()()()(((()(((()((()((((()(((()()(()()((()((()()()((()()(()()()()(()
()()()(()()()()(()(())))))))))))))))))))))))))))))))))))))))))))))))))

Lisp

;;; HWorld.lsp

;;; ================================================== ;;;
;;; =========== HELLO WORLD SIMULATION ============== ;;;
;;; ================================================== ;;;


;;; This function simply returns the string Hello World that is in quotes.

(DEFUN HELLO ()
  "HELLO WORLD"
) 

Whitespace

Es solo para divertirse

S S S T	S S T	S S S L
T	L
S S S S S T	T	S S T	S T	L
T	L
S S S S S T	T	S T	T	S S L
T	L
S S S S S T	T	S T	T	S S L
T	L
S S S S S T	T	S T	T	T	T	L
T	L
S S S S S T	S T	T	S S L
T	L
S S S S S T	S S S S S L
T	L
S S S S S T	T	T	S T	T	T	L
T	L
S S S S S T	T	S T	T	T	T	L
T	L
S S S S S T	T	T	S S T	S L
T	L
S S S S S T	T	S T	T	S S L
T	L
S S S S S T	T	S S T	S S L
T	L
S S S S S T	S S S S T	L
T	L
S S L
L
L

Piet

Punteros

Si os quereis reir un rato....

Gracias

Ruegos y preguntas?

We're hiring!

Bibliografia

  • http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html
  • https://dbader.org/
  • https://learnpythonthehardway.org/
  • GIPHY
  • Google

Introducción a Python

By adaJS

Introducción a Python

Otra introduccion a python. By @mikanchu

  • 1,546