Im building a database to hold files i am using anydbm and what i would like is something that does this:
import Tkinter
import anydbm
import tkFileDialog
file = tkFileDialog.askopenfile(parent=None,mode='rb',title='Choose a file')
print file
print str(file)
db = anydbm.open("database", "c")
# db["1"] = str(file)
for file in files
db[len(database) + 1] = [str(file)]
db.close()
what i mean is as another file is selected a new key is created that is one higher than the highest number in the key. and the new file is added to that key so that key #1 = file #1 and key 2 = file 2
i do not want to have a set number of keys so i can run the script again and have a expanging database without re-writing the script. thanks so much in advance