Replies: 4 comments
-
Duplicated with #117 |
Beta Was this translation helpful? Give feedback.
-
You can use Here is sample code. targets = ['siivagunner_pages_current.xml']
with SevenZipFile('siivagunner_pages_current.xml.7z', 'r') as zip:
for fname, bio in zip.read(targets).items():
print(bio.read()) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the example @miurahr If my targets are text files, should I made further conversions to the output of bio.read()? Also, regarding your linked example code in documentation:
Are we opening the compressed file twice? Sorry if these are pretty basic python questions, non py7zr related. But just in case Thanks |
Beta Was this translation helpful? Give feedback.
-
Bing chat answered
|
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Hi,
It would be nice to get a file-like object of an unextracted file contained within the archive, kind of like how python's
zipfile
works:Describe the solution you'd like
A clear and concise description of what you want to happen.
Would like to see the same with py7zr:
Describe alternatives you've considered
Extracting to directories works, but in this instance I have a
.7z
file with a single file contained within, that I am only interested in ephemerally.Beta Was this translation helpful? Give feedback.
All reactions