我想使用pybloomfilter包:https://github.com/axiak/pybloomfiltermmap,我成功地在python3下安装了它,但是保存的文件似乎没有原始信息(在python2下,这不会发生),我查看了源代码,似乎没有任何特定于python2的东西,所以我完全不知道如何使这个库与python3兼容。
EDIT1:我所说的“没有原始信息”,我的意思是,当我在过滤器中添加一些字符串,然后我结束程序,下一次,我使用打开加载过滤器,过滤器是清楚的,它不记得添加的字符串。
发布于 2017-02-20 02:31:11
pybloomfiltermmap3是Michael (@ Axiak )的Python3叉的pybloomfiltermmap。
class pybloomfilter.BloomFilter(capacity : int, error_rate : float[,
filename=None : string ][, perm=0755 ])安装:
请安装Cython。请注意,这个版本是用于Python3的。如果您正在使用Python2,请参见https://github.com/axiak/pybloomfiltermmap。
安装:
$ pip install cython
$ pip install pybloomfiltermmap3要构建和安装模块,请执行以下操作。
还有一个实例方法来同步文件:
BloomFilter.sync()
Forces a sync() call on the underlying mmap file object.
Use this if you are about to copy the file and you want to be Sure (TM)
you got everything correctly.https://stackoverflow.com/questions/36109807
复制相似问题