Python 3.x Python解压缩zip文件避免垃圾路径
在ubuntu中,提取zip文件时,有一个选项Python 3.x Python解压缩zip文件避免垃圾路径,python-3.x,ubuntu,unzip,Python 3.x,Ubuntu,Unzip,在ubuntu中,提取zip文件时,有一个选项-j: junk paths. The archive's directory structure is not recreated; all files are deposited in the extraction directory (by default, the current one). 我正在python中搜索此类选项,但没有找到任何适用于我的代码的成功选项: with zipfile.Zip
-j
:
junk paths. The archive's directory structure is not recreated; all files are
deposited in the extraction directory (by default, the current one).
我正在python中搜索此类选项,但没有找到任何适用于我的代码的成功选项:
with zipfile.ZipFile(my_file) as zip_ref:
zip_ref.extractall(my_path)
我如何处理这种情况
非常感谢您提供的信息