Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def files():
  2. with rarfile.RarFile(archive_path) as rar:
  3. for filename in rar.namelist():
  4. yield filename, rar.open(filename)
  5.  
  6. with tarfile.TarFile.xzopen('archive.lzma','w') as tarf:
  7. for filename, file in files():
  8. tarf.addfile(tarfile.TarInfo(filename),file)
  9. file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement