
1 nowheremanx Oct 6, 2023 换个思路,考虑下 subprocess 召唤 unrar |
2 monkeyWie Oct 6, 2023 这种问题问 chatGPT 就行了 |
3 nuk Oct 6, 2023 tar 格式根本就不支持加密。。。 |
4 Kirscheis Oct 6, 2023 |
5 Maysec Oct 6, 2023 tar 是类似 iso 的格式 不支持加密吧 |
6 netsys Oct 8, 2023 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("使用密码解压成功") |