# import bsddb # Where the 'words' is. WORDS = '/usr/share/dict/words' # words database DB = 'words.db' db = bsddb.btopen(DB, 'c') for word in file(WORDS): word = word.strip().lower() db[word] = '1' db.close()