]> git.phdru.name Git - m_lib.git/blob - m_lib/hash/test/test-shelve6.py
Use print function for Py3 compatibility
[m_lib.git] / m_lib / hash / test / test-shelve6.py
1 #! /usr/bin/env python
2
3
4 from __future__ import print_function
5 import anydbm, dbhash
6 anydbm._defaultmod = dbhash
7
8
9 from m_lib.hash import zshelve
10
11 db = zshelve.CompressedKeysShelf("dbz", 'n')
12 db["test"] = "Test Ok!"
13 db.close()
14
15 db = zshelve.CompressedKeysShelf("dbz", 'r')
16 print(db.has_key("test"))
17 print(db.keys())
18 print(db["test"])
19 db.close()