I have a .db file created with SQLite3. I want to use anydbm to read this file.
My code:
import anydbm
db = anydbm.open('mydb.db', 'r')
However, it throws this error –> “anydbm.error: db type could not be determined”
I don’t get it. What is wrong with this? The file type according to the Unix file command is SQLite 3.x.
Does anybody know what’s causing this? Also, is there a better library for reading .db files?
Thanks
Anydbm module is only for db/dbm/gdbm type of files. It does not work at all with sqlite. They are not the same thing, and don’t have the same file format. Use the sqlite module for SQLite databases.