Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #90073 > unrolled thread
| Started by | noydb <jenn.duerr@gmail.com> |
|---|---|
| First post | 2015-05-06 13:27 -0700 |
| Last post | 2015-05-06 21:45 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.python
extracting zip item to in-memory noydb <jenn.duerr@gmail.com> - 2015-05-06 13:27 -0700
Re: extracting zip item to in-memory Dave Angel <davea@davea.name> - 2015-05-06 16:38 -0400
Re: extracting zip item to in-memory Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-06 21:45 +0100
| From | noydb <jenn.duerr@gmail.com> |
|---|---|
| Date | 2015-05-06 13:27 -0700 |
| Subject | extracting zip item to in-memory |
| Message-ID | <95e1cce0-18ed-477a-a265-3256b7bcb25a@googlegroups.com> |
I have a zip file containing several files and I want to extract out just the .xml file. I have that code. Curious if this xml file can be extracted into memory. If so, how to? I only need to move the file around, and maybe read some tags. Thanks for any help! python 2.7
[toc] | [next] | [standalone]
| From | Dave Angel <davea@davea.name> |
|---|---|
| Date | 2015-05-06 16:38 -0400 |
| Message-ID | <mailman.191.1430944712.12865.python-list@python.org> |
| In reply to | #90073 |
On 05/06/2015 04:27 PM, noydb wrote: > I have a zip file containing several files and I want to extract out just the .xml file. I have that code. Curious if this xml file can be extracted into memory. If so, how to? I only need to move the file around, and maybe read some tags. > > Thanks for any help! > > python 2.7 > See https://docs.python.org/2.7/library/zipfile.html#zipfile.ZipFile.open To open a particular member and get back a file-like object. Once you have that, you can use the read() method of that object. Once you've coded this, if it doesn't work, post what you've got with a description of what doesn't work, and somebody here will be able to fix it up. -- DaveA
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2015-05-06 21:45 +0100 |
| Message-ID | <mailman.192.1430945144.12865.python-list@python.org> |
| In reply to | #90073 |
On 06/05/2015 21:27, noydb wrote: > I have a zip file containing several files and I want to extract out just the .xml file. I have that code. Curious if this xml file can be extracted into memory. If so, how to? I only need to move the file around, and maybe read some tags. > > Thanks for any help! > > python 2.7 > https://docs.python.org/2/library/xml.html#module-xml -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web