Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Aulas Python - 079 - Armazenamento de Dados V: shelve
Play lesson

Aulas Python - Aulas Python - 079 - Armazenamento de Dados V: shelve

Descubra o poder da programação com 'Aulas Python', o curso definitivo que transforma iniciantes em mestres do código. Comece sua jornada com Ignorância Zero e aprenda Python de forma prática e eficiente!

5.0 (4)
42 learners

What you'll learn

Desenvolver habilidades em programação utilizando Python de forma inicial e avançada
Compreender conceitos fundamentais de programação orientada a objetos
Implementar interações com usuários através de interfaces gráficas
Manipular dados e executar operações de automação em bancos de dados

This course includes

  • 49 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

1) import shelve 2) file = shelve.open(filename) -- abre ou cria um novo db 3) file[key] = value -- guarda um valor na chave 4) value = file[key] -- recebe valor da chave 5) count = len(file) -- número de chaves 6) index = file.keys() -- coloca os valores das chaves numa lista 7) found = key in file 8) del file[key] 9) for key in file 10) file.close() 11) file[key] = list 12) file[key].append(element) -- list permanece nao modificada 13) temp = file[key] - temp.append(element) - file[key] = temp 14) file = shelve.open(filename, writeback = True) permite que os objetos sejam modificaveis pois todos estão armazenados temporariamente na memória, mas torna o programa mais lento Bibliografia Sites: http://docs.python.org/3.4/library/shelve.html pymotw.com/2/shelve/ python.about.com/od/pythonstandardlibrary/a/shelve_intro.htm Livros: Beginning python from novice to professional - Cap. 10, The Standard Library: A Few Favorites, shelve Aprendendo Python - 848 a 853 Programming Python - 1316 a 1323 Dropbox: https://www.dropbox.com/sh/t0lvoxb2fxfhctx/AABIYnYyvqPby6oq0NkQWpRaa

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere