How do I list contents of a gz file without extracting it in python?
问题 I have a .gz file and I need to get the name of files inside it using python. This question is the same as this one The only difference is that my file is .gz not .tar.gz so the tarfile library did not help me here I am using requests library to request a URL. The response is a compressed file. Here is the code I am using to download the file response = requests.get(line.rstrip(), stream=True) if response.status_code == 200: with open(str(base_output_dir)+"/"+str(current_dir)+"/"+str(count)+"