手机
当前位置:查字典教程网 >脚本专栏 >python >Python获取文件ssdeep值的方法
Python获取文件ssdeep值的方法
摘要:本文实例讲述了Python获取文件ssdeep值的方法,分享给大家供大家参考。具体方法如下:首先,得到ssdeep值,需要先importss...

本文实例讲述了Python获取文件ssdeep值的方法,分享给大家供大家参考。具体方法如下:

首先,得到ssdeep值,需要先import ssdeep

在ubuntu上安装pyssdeep时 一直出错 后来发现apt-cache search "ssdeep"时把几个全apt-get install 上,但问题依旧。

后来下载到pyssdeep的源文件 ,tar zxvf pyssdeep.tar.zip 然后 apt-get install python-dev 然后 python setup.py install 就安装上了。

总体来看应该是没装python-dev的原因。

具体代码如下:

def _get_ssdeep(self, file_path): """ Generates the ssdeep fuzzy hash of the file. @return: ssdeep fuzzy hash of the file """ if not IS_SSDEEP: return None try: return ssdeep.ssdeep().hash_file(file_path) except: return None

希望本文所述对大家的Python程序设计有所帮助。

【Python获取文件ssdeep值的方法】相关文章:

用python分割TXT文件成4K的TXT文件

python操作日期和时间的方法

python实现问号表达式(?)的方法

python读取csv文件示例(python操作csv)

Python中使用中文的方法

python函数返回多个值的示例方法

Python下singleton模式的实现方法

python条件和循环的使用方法

Python通过解析网页实现看报程序的方法

python处理文本文件实现生成指定格式文件的方法

精品推荐
分类导航