shelve ファイルを作成し、辞書データを挿入しました。ここで、その保留ファイルをクリーンアップして、クリーン ファイルとして再利用したいと考えています。
import shelve
dict = shelve.open("Sample.db")
# insert some data into sample.db
dict = { "foo" : "bar"}
#Now I want to clean entire shelve file to re-insert the data from begining.