-
Notifications
You must be signed in to change notification settings - Fork 23
Python development
libevt comes with Python-bindings named pyevt.
Below are examples how use pyevt. They assume you have a working version of pyevt on your system. To build pyevt see Building.
To be able to use pyevt in your Python scripts add the following import:
import pyevt
The get_version() module function can be used to retrieve the version of the pyevt.
pyevt.get_version()
This will return a textual string (Unicode) that contains the libevt version. Since pyevt is a wrapper around libevt it does not have a separate version.
evt_file = pyevt.file()
evt_file.open("AppEvent.evt")
...
evt_file.close()
The explicit call to evt_file.close() is not required. Close only must be called once all operations on the file have been completed.
file_object = open("AppEvent.evt", "rb")
evt_file = pyevt.file()
evt_file.open_file_object(file_object)
...
evt_file.close()
The explicit call to evt_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 pyevt
help(pyevt)
help(pyevt.file)