-
Notifications
You must be signed in to change notification settings - Fork 9
Python development
libmsiecf comes with Python-bindings named pymsiecf.
Below are examples how use pymsiecf. They assume you have a working version of pymsiecf on your system. To build pymsiecf see Building.
To be able to use pymsiecf in your Python scripts add the following import:
import pymsiecf
The get_version() module function can be used to retrieve the version of the pymsiecf.
pymsiecf.get_version()
This will return a textual string (Unicode) that contains the libmsiecf version. Since pymsiecf is a wrapper around libmsiecf it does not have a separate version.
msiecf_file = pymsiecf.file()
msiecf_file.open("index.dat")
...
msiecf_file.close()
The explicit call to msiecf_file.close() is not required. Close only must be called once all operations on the file have been completed.
file_object = open("index.dat", "rb")
msiecf_file = pymsiecf.file()
msiecf_file.open_file_object(file_object)
...
msiecf_file.close()
The explicit call to msiecf_file.close() is not required. Close only must be called once all operations on the file have been completed and will not close the file-like object itself.
import pymsiecf
help(pymsiecf)
help(pymsiecf.file)