【脚本语言系列】关于Python持久化dbhash,你需要知道的事
来源:互联网 发布:一建试题软件 编辑:程序博客网 时间:2024/05/22 10:43
如何使用dbhash
# -*- coding:utf-8 -*-import dbhashdb = dbhash.open("temp","c")db['One'] = "Bejing road"db['Two'] = "Shanghai road"for k, v in db.iteritems(): print k, vif db.has_key("One"): del db["One"]print dbdb.close()
One Bejing roadTwo Shanghai road{'Two': 'Shanghai road'}
什么是dbhash
DBM是采用哈希结构进行存储的文件式数据库。
DBM比普通文件稳定可靠而且查询速度库。
Windows操作系统使用dbhash模块,而且Unix操作系统使用gdbm模块。
阅读全文
0 0
- 【脚本语言系列】关于Python持久化dbhash,你需要知道的事
- 【脚本语言系列】关于Python持久化anydbm,你需要知道的事
- 【脚本语言系列】关于Python持久化shelve,你需要知道的事
- 【脚本语言系列】关于Python系统管理,你需要知道的事
- 【脚本语言系列】关于Python容器,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理YAML,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理csv,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理xml,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理HTML,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理JSON,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理配置文件.ini,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理MsgPack,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理Avro,你需要知道的事
- 【脚本语言系列】关于Python结构化文本文件处理Thrift,你需要知道的事
- 【脚本语言系列】关于Python结构化二进制文件处理Microsoft Excel,你需要知道的事
- 【脚本语言系列】关于Python结构化二进制文件处理HDF5,你需要知道的事
- 【脚本语言系列】关于Python调试报错,你需要知道的事
- 【脚本语言系列】关于Python开发环境搭建,你需要知道的事
- Android实现二级联动
- 最简单最全的RabbitMQ安装教程
- eclipse使用gitHub
- 《JavaScript DOM编程艺术》第十章 用javascript实现动画效果
- 线段树区间更新 Just a Hook
- 【脚本语言系列】关于Python持久化dbhash,你需要知道的事
- ssh登录
- 正则使用注意事项
- Go游戏服务器开发的一些思考(二):综合考察(上)
- PHP PDO::execute()执行insert into失败返回错误无错误消息的解决
- String、StringBuffer与StringBuilder之间区别
- CRC32
- IE11的一些小问题
- 使用cout输出16进制,8进制,2进制