Python e Comunidade
O que isso tem em comum?
by @rg3915

Regis da Silva Santos
- Matematico não praticante pela UFMT
- Analista de Sistemas pelo Senac-SP
- Pai
- Programador em Python e Django
- Um dos organizadores do GruPy-SP e SciPy-SP
@rg3915


Comunidade
Comunidade
"é comumente considerada uma unidade social que compartilham algo em comum, como normas, valores, identidade e lugar em que estão situadas em uma determinada área geográfica ou não..."

Python Brasil 13
Belo Horizonte - 2017

Python Brasil 12
Florianópolis 2016

Python Brasil 11
São José dos Campos - 2015


Title Text










PyBar

PyBar


PESSOAS > TECNOLOGIA

Eu vim pela linguagem e fiquei pela comunidade.
Brett Cannon @brettsky

42 videos +2h cada

32 videos e contando...


Guido van Rossum
@gvanrossum
Python foi criado
em 1991

O nome Python veio de
Monty Python's Flying Circus.
Grupo humorístico Britânico

É uma linguagem interpretada
com tipagem forte
e dinâmica
v 3.6.3
Linguagem Interpretada
"O código é compilado em tempo de execução"
Tipagem Forte
O Python não transforma um tipo em outro implicitamente.
Exemplo, '1' + 1 em Python dá erro. Em outras linguagens dá '11'.
Tipagem Dinâmica
A identificação do tipo acontece em Runtime.
Em oposição à tipagem estática quando você define o tipo no código fonte como em C, por exemplo.
>>> a = 42
>>> type(a)
<class 'int'>
>>> b = 3.14
>>> type(b)
<class 'float'>
>>> t = 'palavra'
>>> type(t)
<class 'str'>

Vantagens do Python
-
Legível
-
Fácil de aprender
-
Não é verboso
-
Multiplataforma
-
Win, Linux, Mac
-
Raspberry Pi
-
Android com Termux
-


Como usar Python?
O que você precisa para usar o Python?
- Terminal (ou Cmder)
- Editor de texto
- Vim
- Nano
- Gedit
- Atom
- Sublime Text
- Notepad ++
- IDE
- PyCharm


Live Coding
$ python3
Python 3.5.2 (default, Aug 18 2017, 17:48:00)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> print('Hello World')
Hello World
>>>
from datetime import datetime
from time import sleep
while True:
hora = datetime.now()
print(hora.strftime('%H:%M:%S'))
sleep(1)
Além do Hello World

def eh_impar(n):
if n % 2:
return True
return False
if __name__ == '__main__':
numbers = [-2, -1, 0, 1, 2, 3, 4, 5]
for number in numbers:
if eh_impar(number):
print('%s é impar' % number)
else:
print('%s é par' % number)
>>> dias = ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta',
'sábado']
>>> for i, dia in enumerate(dias, 1):
... print(i, dia)
...
1 domingo
2 segunda
3 terça
4 quarta
5 quinta
6 sexta
7 sábado
>>> lc = [n ** 2 for n in range(11)]
>>> print(lc)
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
estados = {
'AC': 'Acre',
'AL': 'Alagoas',
'BA': 'Bahia',
'RJ': 'Rio De Janeiro',
'SP': 'São Paulo',
}
for estado in estados:
print(estado)
for estado in estados:
print(estados[estado])
for k, v in estados.items():
print(k, v)
>>> import this

Livros

Allen B. Downey
Ed. Novatec

Brett Slatkin
Ed. Novatec

Luciano Ramalho

42 videos +2h cada

32 videos e contando...
Telegram: @livepython




grupy-sp
@grupysp
@grupysaopaulo


@rg3915


OBRIGADO
python-e-comunidade
By Régis Silva
python-e-comunidade
Apresentado na X Semtec - IFSP - Bragança Paulista
- 1,759