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