Commit | Line | Data |
---|---|---|
5bde3efa ACK |
1 | #!/usr/bin/env python |
2 | import os | |
3 | import lmdb | |
4 | ||
5 | if os.path.exists('2800.mdb'): | |
6 | os.unlink('2800.mdb') | |
7 | ||
8 | env = lmdb.open('2800.mdb', subdir=False); | |
9 | with env.begin(write=True) as txn: | |
10 | txn.put('first', 'data for first') | |
11 | txn.put('second', 'A=1 B=2') | |
12 | txn.put('third', 'A1:B2:C3') | |
13 | cursor = txn.cursor() | |
14 | for key, value in cursor: | |
15 | print key, "=>", value |