Parse .iso files in Python [duplicate]

落爺英雄遲暮 提交于 2019-12-10 12:46:00

问题


I want to parse .iso file in python. I want to get information and data from .iso

for example there is a iso file, its name xyz.iso but in fact it is a ubuntu image and it has file like Readme.txt, .deb pacges etc. How can i do for this?


回答1:


Have you tried Hachoir? It allows you to view or edit binary streams, and it supports ISO as shown on their documentation It would allow you to browse the files and folders inside the ISO file.




回答2:


You can use for listing and extracting, I tested the first.

https://github.com/barneygale/iso9660/blob/master/iso9660.py

import iso9660
cd = iso9660.ISO9660("/Users/murat/Downloads/VisualStudio6Enterprise.ISO")
for path in cd.tree():
    print path


来源:https://stackoverflow.com/questions/6636761/parse-iso-files-in-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!