1 nowheremanx 2023-10-06 08:32:49 +08:00 ![]() 换个思路,考虑下 subprocess 召唤 unrar |
![]() | 2 monkeyWie 2023-10-06 09:09:42 +08:00 这种问题问 chatGPT 就行了 |
![]() | 3 nuk 2023-10-06 09:28:24 +08:00 ![]() tar 格式根本就不支持加密。。。 |
![]() | 4 Kirscheis 2023-10-06 10:30:31 +08:00 |
![]() | 5 Maysec 2023-10-06 15:49:33 +08:00 tar 是类似 iso 的格式 不支持加密吧 |
![]() | 6 netsys 2023-10-08 11:30:00 +08:00 import tarfile tar = tarfile.open("a.tar", "r:") try: tar.extractall(path=".", members=tar) # 无密码解压 print("文件解压成功") except tarfile.ReadError: passwd = "password" # 此处填写解压密码 tar.extractall(path=".", members=tar, pwd=passwd.encode('utf-8')) print("使用密码解压成功") |