압축 된 데이터 파일 (폴더 안에 모두있는 다음 압축)이 있습니다. 압축을 풀지 않고 각 파일을 읽고 싶습니다. 몇 가지 방법을 시도했지만 아무 것도 zip 파일의 폴더를 입력하는 작동합니다. 어떻게해야합니까? zip 파일의 폴더없이Python의 압축 폴더에서 텍스트 파일을 읽는 방법
:
with zipfile.ZipFile('data.zip') as z:
for filename in z.namelist():
data = filename.readlines()
하나 개의 폴더로 :
with zipfile.ZipFile('data.zip') as z:
for filename in z.namelist():
if filename.endswith('/'):
# Here is what I was stucked