首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Python > A python module similar to shelve but using an sqlite3 (or other) database as a back end.

A python module similar to shelve but using an sqlite3 (or other) database as a back end.

  • 资源大小:2.14 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: end

资 源 简 介

`pdict` is a simple module that provides a `dict`-like type called `PersistentDict` which will persist the dictionary to a database of your choice. Whenever an items is requested, added, changed, or removed, the data is read from/written to a database. The values in the dict can be an object of any type that is serializable by the `pickle` module. This is handy for when you want to save preferences, current state and other data between uses of your program. Usage is very simple, for example: ``` >>> from pdict import PersistentDict >>> cfg = PersistentDict("testfile.cfg") >>> cfg["test1"] = "testval1" >>> cfg["test2"] = "testval2" >>> print cfg {"test1": "testval1", "test2": "testval2"} >>> ``` To install the `pdict` module, just download the the tarball or checkout the source and move the `pdict` directory to somewhere accessible by Python. There should be a proper installer and/or egg in the next few revisions.

文 件 列 表

pdict
.svn
__init__.py
test.py

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP
0.192531s