description_restoration.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:toollabs 作者: multichill 项目源码 文件源码
def findDuplicateImages(filename, site = wikipedia.getSite(u'commons', u'commons')):
    '''
    Takes the photo, calculates the SHA1 hash and asks the mediawiki api for a list of duplicates.

    TODO: Add exception handling, fix site thing
    '''
    f = open(filename, 'rb')

    hashObject = hashlib.sha1()
    hashObject.update(f.read(-1))
    return site.getFilesFromAnHash(base64.b16encode(hashObject.digest()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号