title: How do I make shelve file empty in python?
body: <p>I have created a shelve file and inserted a dictionary data. Now I want to cleanup that shelve file to reuse as a clean file.</p>
  
  <pre><code>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.
  </code></pre>