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

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

Aulas Python - 079 - Armazenamento de Dados V: shelve Transcript and Lesson Notes

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

Quick Summary

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

Key Takeaways

  • Review the core idea: 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
  • Understand how Python fits into Aulas Python - 079 - Armazenamento de Dados V: shelve.
  • Understand how Aulas fits into Aulas Python - 079 - Armazenamento de Dados V: shelve.
  • Understand how Curso fits into Aulas Python - 079 - Armazenamento de Dados V: shelve.
  • Understand how Software fits into Aulas Python - 079 - Armazenamento de Dados V: shelve.

Key Concepts

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

Lesson FAQs

What is Aulas Python - 079 - Armazenamento de Dados V: shelve about?

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

What key concepts are covered in this lesson?

The lesson covers Python, Aulas, Curso, Software, Programação.

What should I learn before Aulas Python - 079 - Armazenamento de Dados V: shelve?

Review the previous lessons in Aulas Python, then use the transcript and key concepts on this page to fill any gaps.

How can I practice after this lesson?

Practice by applying the main concepts: Python, Aulas, Curso, Software.

Does this lesson include a transcript?

Yes. The full transcript is visible on this page in indexable HTML sections.

Is this lesson free?

Yes. CourseHive lessons and courses are available to learn online for free.

Continue Learning

Course Hive

Continue this lesson in the app

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

Related Lessons

Related Courses

FAQs

Course Hive
Download CourseHive and keep learning anywhere
Get App