0

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

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.