如何使用Python将.7z文件转换为.rar或.zip文件?
答案 0 :(得分:0)
您可以分两步完成此操作。首先,解压缩.7z文件,然后将内容压缩为zip文件。
解压缩.7z文件
return RedirectToAction("Index", "Companies");
参考:https://github.com/harvimt/pylib7zip
压缩到zip文件
from lib7zip import Archive, formats
with Archive('filename.7z') as archive:
# extract all items to the directory
# directory will be created if it doesn't exist
archive.extract('directory')