tarファイルのメソッドを抽出

ファイルディレクトリPYにファイルを作成します。

import tarfile
import os

file_path = ‘its name’
target_path = ‘where u put’
tar = tarfile.open(file_path, mode = "r")
file_names = tar.getnames()
for file_name in file_names:
    print(file_name)
    tar.extract(file_name, target_path)
tar.close()
リリース3元の記事 ウォンの賞賛0 ビュー65

おすすめ

転載: blog.csdn.net/weixin_43535188/article/details/104077415