readers, This is our introduction part of python shelve module tutorial
series and in this part, We will discuss what is shelve? and what are the usages of python shelve
But First If You Are New Visitor,
Then, Don't Forget To Check Our Index Because their You can find really many interesting stuff.
So, let's start our discussion.
our first question is.
Q 1. What Is Shelve?
Ans. Shelve is a dictionary-like object use for storing python object. this module is very easy to use
because its interface completely works like a python dictionary object. this module is managed by
python anydbm module.
Q 2. The difference between shelve and anydbm module?.
Ans. Shelve Is Completely Based on anydbm python module but the difference is shelve pickle data
for storing and writtind data in database. that's why any python object that can handle by pickle
python module. you can store it in shelve database.
# Importing Modules
# db_name = Name Of Database.
db_name = "example_database_shelve.db"
# Open Database And Create Shelve Object handler.
db = shelve.open(db_name)
# Creating A List Only For Exmaple Purpose
storelist = ["Dog",
# Storelist In Database.
db['store_list'] = storelist
# Close Database
So, stay tunned with us.
For More Update, Visit Our Blog Regularly.
For Any Type of Suggestion, Help Or Question