Oficina de Python - Tchelinux Livramento 2013
-
Upload
jeronimo-medina-madruga -
Category
Technology
-
view
461 -
download
0
description
Transcript of Oficina de Python - Tchelinux Livramento 2013
![Page 1: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/1.jpg)
Primeiros passos em programação utilizando Python
Por Jerônimo Medina Madruga
![Page 2: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/2.jpg)
![Page 3: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/3.jpg)
+ info: http://goo.gl/qE9BT
![Page 4: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/4.jpg)
- Quem é você?
![Page 5: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/5.jpg)
Não tenho ligação com o seu Madruga
¬¬
![Page 6: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/6.jpg)
![Page 7: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/7.jpg)
Material da palestra
http://192.168.254.39:8000/
![Page 8: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/8.jpg)
A primeira vez a gente nunca
esquece...
![Page 9: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/9.jpg)
Vamos começar pela história...
![Page 10: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/10.jpg)
As origens do Python
Criada em 1991 por Guido Van Rossum
Nome inspirado pelo “Monty Python Flying Circus”
Simplicidade e fácil aprendizado
![Page 11: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/11.jpg)
Mote do Python
“O que nós podemos fazer para transformar a programação em uma experiência o mais fácil
possível?”
Guido Van Rossum
![Page 12: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/12.jpg)
Onde eu posso encontrar Python?
Já vem em qualquer sistema operacional moderno :D
Para Windows você tem de fazer o download :P
![Page 13: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/13.jpg)
Que empresas utilizam Python?
GoogleYoutube
Nasa...
![Page 14: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/14.jpg)
Características do Python
Escalável RAD Portável e multiplataforma Extensível Orientada a objetos Biblioteca padrão com muitos recursos Diversas bibliotecas de terceiros
![Page 15: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/15.jpg)
Vantagens do Python
Organizado por natureza
Não é restrito a ideias antigas
Performance e produtividade andam juntos
Dá liberdade ao programador
Constante atualização da linguagem
![Page 16: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/16.jpg)
Vantagens do Python
Menos marketing, mais evolução
Menor “enrolação” no código
Linguagem mais próxima do natural
Maior foco nos conceitos
![Page 17: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/17.jpg)
Qual é o foco do Python?
Produtividade e qualidade.
Nada de amarras.
![Page 18: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/18.jpg)
Elementos essenciais para programar em Python?
Editor e interpretador
Sugestão: IDLE (IDE Python padrão)
Alternativas: vim+shell python, Stani's Python Editor, Eclipse, etc...
![Page 19: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/19.jpg)
Hora de praticar!
Exercícios retirados do livro “Use a cabeça programação”
http://www.headfirstlabs.com/books/hfprog/hfprog_resources.zip
Algumas observações e correções das versões originais:
http://programming.itcarlow.ie/resources.html
![Page 20: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/20.jpg)
O que esse programa faz?
print(“Bem vindo!”)g = input(“Adivinhe o número”)guess = int(g)if guess == 5:
print(“Você ganhou!”)else:
print(“Você perdeu!”)print(“Game over”)
![Page 21: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/21.jpg)
Jogo de adivinhação do 5
print(“Bem vindo!”)g = input(“Adivinhe o número”)guess = int(g)if guess == 5:
print(“Você ganhou!”)else:
print(“Você perdeu!”)print(“Game over”)
![Page 22: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/22.jpg)
Como transformar isso em um jogo do “quente e frio”?
![Page 23: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/23.jpg)
Temos como fazer o jogo rodar repetidamente?
![Page 24: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/24.jpg)
Aprendizado com o primeiro exercício?
Os programas são criados a partir de códigos de instruções (desvios, comandos, laços)
As condições ajudam a decidir o que é verdadeiro ou falso
Um valor nomeado é inserido dentro de uma variável
![Page 25: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/25.jpg)
Aprendizado com o segundo exercício
Strings são sequências de caracteres individuais.
Os caracteres de string individuais são referidos pelo indice.
Os valores do índice são deslocamentos que iniciam em zero.
Os métodos fornecem variáveis com funcionalidade embutida.
![Page 26: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/26.jpg)
Livros recomendados
Use a Cabeça Programação
Use a Cabeça Python
Introdução à programação com Python
![Page 27: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/27.jpg)
Livros gratuitos recomendados
Python para desenvolvedores
Como Pensar como um Cientista de Computação em Python
Documentação do python
![Page 28: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/28.jpg)
Outras referências
Python para zumbis – Fernando Masanori
Google Python Class – Youtube
PyCon - Evento
![Page 30: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/30.jpg)
Y la Pregunta?
![Page 31: Oficina de Python - Tchelinux Livramento 2013](https://reader033.fdocument.pub/reader033/viewer/2022052522/54830538b07959650c8b4923/html5/thumbnails/31.jpg)
Fim! :D