I would like to use the dbm module on my Windows machine, but it is currently only supported on Unix. http://docs.python.org/library/dbm.html
Does anyone know of a similar module with similar syntax or a workaround to get dmb functional on windows? Being able to access a database written to the hard drive much like how I code to access a dictionary would be great. Thank you for your help!
GitHub - LuaDist/libgdbm: GNU dbm is a set of database routines that use extendible hashing and works similar to the standard UNIX dbm routines.
Actually, after more googling around, I found this:
http://docs.python.org/library/anydbm.html#module-anydbm
I've tried this on windows and it seems to be working fine =)
Based on the following test on a Windows 7 system using Python 2.7.2 it appears that dbhash is supported on Windows instalations.
import os
import anydbm
import whichdb
file = os.curdir + '/testdbm' # define a test file name in the current directory
d = anydbm.open(file, 'c') # create a new database using the test file name
db_type = whichdb.whichdb(file) # get the dbm database type
print(db_type) # display the result
'dbhash'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With