在python中读取OLE文件元数据

时间:2018-11-05 19:35:59

标签: python-3.x ole

我当前正在尝试使用此库(https://www.decalage.info/olefile)读取Office文件中的OLE元数据,但是所选文件(我确定是正确的类型)似乎没有显示为使用下面的测试的基于OLE的文件-我不确定为什么会这样,因为我看不到下面的代码有什么问题:

import olefile
from oletools import olemeta, olebrowse, oleid
from tkinter.filedialog import askopenfilename

def get_file():
    file = askopenfilename()
    return file

file = get_file()

with open(file, mode='rb') as file:
    if olefile.isOleFile(file):
        print("true")
    else:
        print("false")

有什么想法吗?如果有更好的读取元数据的方法,那也没问题-我的库还没有固定。

0 个答案:

没有答案