nod库的python绑定。

nod的Python项目详细描述


PY节点

python 3.6 NOD的绑定,一个用于遍历、转储和创作的库 GameCube和Wii光盘图像。

用法

拆包

importnoddefprogress_callback(path,progress):ifargs.verbose:print("Extraction {:.0%} Complete; Current node: {}".format(progress,path))context=nod.ExtractionContext()context.set_progress_callback(progress_callback)try:disc,is_wii=nod.open_disc_from_image("game.iso")data_partition=disc.get_data_partition()ifnotdata_partition:raiseRuntimeError("Could not find a data partition in the disc.")data_partition.extract_to_directory("dir_out",context)exceptRuntimeErrorase:raiseException("Could not extract disc at 'game.iso' to 'dir_out': {}".format(e))

包装

importnodifnod.DiscBuilderGCN.calculate_total_size_required("dir_out")isNone:raiseException("Image built with given directory would pass the maximum size.")deffprogress_callback(progress:float,name:str,bytes:int):print("\r"+" "*100,end="")print("\r{:.0%}{}{} B".format(progress,name,bytes),flush=True)disc_builder=nod.DiscBuilderGCN("game.iso",fprogress_callback)try:disc_builder.build_from_directory("dir_out")exceptRuntimeErrorase:raiseException("Failure building the image: {}".format(e))

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
ArrayList中实体对象上的JAVA泛型   带Redis的爪哇芹菜vs单用Redis   java在设备面向横向时隐藏标题栏/通知栏   java JXTreeTable:如何使用ComponentProvider为一列设置渲染器   java创建异常的成本与记录异常的成本相比   java在方法参数中使用setter传递新对象   java在一个类中的方法与另一个类中的方法交互时遇到问题   java如何迭代2个大小相等的ArrayList   Java getDesktop()。open在Windows中工作,但在Mac中不工作   从tomcat切换到jetty后的java“无法启动嵌入式容器”,Spring引导   java如何使用void方法   java如何在解组时在JAXB的ValidationEventHandler中获取节点值?   如何使用Akka Java API创建不响应的TCP接收器   JavaScriptjQuery在java中将记录上传到数据库时的进度条   如何在重新绘制时在java小程序中显示上一个图像