python读取leveldb数据

2020-01-06 18:10:25 浏览数 (3)

代码语言:javascript复制
import sys
import leveldb
def read_data():
	if len(sys.argv) < 2:
		print "pls input leveldb dir"
		return -1
	db = leveldb.LevelDB(sys.argv[1])
	for k in db.RangeIter(include_value = False):
			print db.Get(k)
if __name__ == '__main__':
	read_data()
	print "read end"

0 人点赞