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