我正在尝试找到一种方法将 iso 图像的内容提取到指定的文件路径。这可以使用 7-Zip 轻松完成,但我找不到 Python 方法来完成它。似乎有一个图书馆
isoparser
https://github.com/barneygale/isoparser,但它没有给出很多如何做到这一点的例子。
有没有人有这方面的经验或可以提供一些例子?
看看这个 lib7zip 绑定.
用法示例:
# pip install git+https://github.com/topia/pylib7zip
from lib7zip import Archive, formats
archive = Archive("cd.iso", forcetype="Iso")
#extract all items to the directory, directory will be created if it doesn't exist
archive.extract('output_dir')
# iterate over archive contents
for f in archive:
if f.is_dir:
continue
print("; %12s %s %s" % ( f.size, f.mtime.strftime("%H:%M.%S %Y-%m-%d"), f.path))