Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
python store save data 1

python store save data

April 15, 2022 by Anurag batra
import shelve

shelf = shelve.open(filename)
shelf['key1'] = value1
shelf['key2'] = value2

shelf.close()

# ---

shelf.open(filename)

value1 = shelf['key1']

Here is what the above code is Doing:
1. Opening the shelf file
2. Storing the value of key1 in the variable value1
3. Closing the shelf file

Categories Python Examples
Post navigation
python string replace index
No handles with labels found to put in legend
© MyEduKit - 2022 . All Rights Reserved.