def get_name(self,id):
db = shelve.open("file.shv")
value = db[id].get("file_path")
db.close()
return db[id].get("file_path")
return db[id].get("file_path") and db.close()
def get_name(self,id):
with shelve.open("file.shv") as db:
return db[id].get('file_path')