You need to change this:
win_rar = 'C:\\Program Files\\WinRAR\\UnRAR.exe'
to this:
win_rar = 'C:\\Program Files\\WinRAR\\WinRAR.exe'
I ran your code successfully with this change (after reproducing your error).
Domanda
The TIF.gz file downloaded from the link below can be successfully extracted by WinRAR GUI mode manually.
However, it could not extract using programming mode using Python. But the similiar method below can extract other tar.gz files:
import subprocess
win_rar = 'C:\\Program Files\\WinRAR\\UnRAR.exe'
tif_gz_file = 'D:\\source\\02AUG15032744-M2AS_R1C1-000000185959_01_P005.TIF.gz'
subprocess.call([win_rar, 'x', tif_gz_file, 'D:\\target\\'])
Any idea would be highly appreciated. I also tried the similiar procesure using 7-Zip, it also did not. I want to extract it using a program. Please help me.
Soluzione
You need to change this:
win_rar = 'C:\\Program Files\\WinRAR\\UnRAR.exe'
to this:
win_rar = 'C:\\Program Files\\WinRAR\\WinRAR.exe'
I ran your code successfully with this change (after reproducing your error).