def delete_object_from_file ( file_name , save_key , file_location ) : file = __os . path . join ( file_location , file_name ) shelve_store = __shelve . open ( file ) del shelve_store [ save_key ] shelve_store . close ( )
deleting a key from a python shelve file
Function to delete objects from a shelve Args : file_name : Shelve storage file name save_key : The name of the key the item is stored in file_location : The location of the file derive from the os module
def delete_object_from_file(file_name, save_key, file_location):
    """
    Function to delete objects from a shelve
    Args:
        file_name: Shelve storage file name
        save_key: The name of the key the item is stored in
        file_location: The location of the file, derive from the os module

    Returns:

    """
    file = __os.path.join(file_location, file_name)
    shelve_store = __shelve.open(file)
    del shelve_store[save_key]
    shelve_store.close()