More Related Content
Similar to Python 3 - tutorial (20)
More from Andrews Medina (11)
Python 3 - tutorial
- 4. divisão
‣ // em vez de /
‣ from __future__ import division
globo
.com
- 5. separe dados binários de string
‣ b”” e u””
‣ unicode e bytes
‣ https://gist.github.com/4128327
globo
.com
- 9. str.format()
‣ “{0} - {1}”.format(“andrews”, 19)
‣ “{name} - {idade}”.format(name=”andrews”, idade=19)
globo
.com
- 13. generators
‣ yield
‣ https://gist.github.com/4128556
globo
.com
- 15. print
‣ from __future__ import print_function
‣ https://gist.github.com/4128557
‣ https://gist.github.com/4128561
globo
.com
- 18. OrderedDict
‣ https://gist.github.com/4128574
globo
.com
- 20. instalação
‣ http://python.org/download/releases/3.3.0/
globo
.com
- 21. virtualenv
‣ pyvenv myenv
‣ python -m venv myenv
globo
.com
- 22. distribute
‣ curl -O http://python-distribute.org/distribute_setup.py
‣ python distribute_setup.py
globo
.com
- 23. pip
‣ easy_install pip
globo
.com
- 25. range, zip, map, filter
‣ retornam iterators
‣ cuidado com “x = range(5)”
globo
.com
- 26. print
‣ objeto
‣ novos parâmetros (sep, end, file, flush)
globo
.com
- 28. class ClassName:
‣ new style
‣ antes era “class ClassName(object):”
globo
.com
- 29. str/bytes
‣ python2 -> str == unicode
‣ python2 -> bytes == str
‣ antes a conversão era implícita
globo
.com
- 30. str/bytes
‣ str (unicode no python2) para representação
‣ bytes (str no python2) para transferência
globo
.com
- 31. int
‣ long foi renomeado para int
globo
.com
- 33. annotations
‣ adiciona meta dados em uma função
‣ https://gist.github.com/4128579
globo
.com
- 34. str.format()
‣ nova maneira de formatar strings
globo
.com
- 37. memoryview
‣ https://gist.github.com/4128582
globo
.com
- 38. FileIO
‣ substitui métodos do módulo os
‣ https://gist.github.com/4128583
globo
.com
- 39. concurrent.futures
‣ https://gist.github.com/4128587
‣ https://gist.github.com/4128588
globo
.com
- 45. 3to2
‣ pip install 3to2
globo
.com
- 46. six
‣ pip install six
globo
.com
- 47. leitura
‣ http://python3porting.com/
‣ http://docs.python.org/3/
‣ http://getpython3.com/diveintopython3/
globo
.com
Editor's Notes
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n