Python tarfile模块

本文介绍了Python tarfile模块的使用,包括检查TAR文件有效性、读取元数据、提取文件、添加和追加文件到存档。示例展示了如何创建、读取和修改TAR文件。
摘要由CSDN通过智能技术生成

Python tarfile module is used to read and write tar archives. Python provides us excellent tools and modules to manage compressed files, which includes (but not limited to) performing file and directory compression with different mechanisms like gzip, bz2 and lzma compression.

Python tarfile模块用于读取和写入tar归档文件。 Python为我们提供了出色的工具和模块来管理压缩文件,其中包括(但不限于)使用gzip,bz2和lzma压缩等不同机制执行文件和目录压缩。

In this post, we will see various practical demonstrations of Python tarfile module functions. This is similar to python zip function. Let’s get started.

在本文中,我们将看到Python tarfile模块功能的各种实际演示。 这类似于python zip函数。 让我们开始吧。

Python tarfile模块 (Python tarfile module)

Python tarfile module provides us functions to perform various operations like:

Python tarfile模块为我们提供了执行各种操作的功能,例如:

  • read and write gzip, bz2 and lzma archives

    读写gzip,bz2和lzma档案
  • read and write POSIX.1-1988 (ustar) format

    读写POSIX.1-1988(ustar)格式
  • read and write support for GNU tar format

    对GNU tar格式的读写支持
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值