1, 下载源代码
shell > wget http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz shell > wget http://pypi.python.org/packages/source/b/bsddb3/bsddb3-5.3.0.tar.gz#md5=d5aa4f293c4ea755e84383537f74be82
2, 解压缩,进入目录
3, 安装berkeley-db
shell > cd build_unix/ shell > ../dist/configure #默认安装在/usr/local/BerkeleyDB.5.3下 shell > make shell > sudo make install4 ,安装 python binding
shell > sudo python setup.py --lflags="/usr/local/BerkeleyDB.5.3/lib/libdb-5.3.so" install
import bsddb db = bsddb.btopen("text.db", "c") # 也可以用hashopen 数据结构不同 db.setdefault("actberw", 1) print db.get("actberw")