擅长:python、mysql、java
<p>你在找像<a href="https://lmdb.readthedocs.org/en/release/#resource-management" rel="nofollow">^{<cd1>}</a>这样的东西吗:</p>
<pre><code>with env.begin() as txn:
with txn.cursor() as curs:
# do stuff
print 'key is:', curs.get('key')
</code></pre>
<h2>更新:</h2>
<p>这可能不是<em>最快的</em>:</p>
<pre><code>with env.begin() as txn:
myList = [ key for key, _ in txn.cursor() ]
print(myList)
</code></pre>
<p><strong>免责声明:</strong>我对库一无所知,只是搜索了它的文档并在文档中搜索了<code>key</code>。</p>