Am 27.08.13 22:45, schrieb accessnew...@gmail.com:
Writing text to a word document (word 2007) using the zipfile module
via python coding (python 2.7). Below if the section of code I am
using to do this. I can't figure out what character I need to use to
get it to add new lines to the zi
Writing text to a word document (word 2007) using the zipfile module via python
coding (python 2.7). Below if the section of code I am using to do this. I
can't figure out what character I need to use to get it to add new lines to the
zipfile.
if Count:
blurb = "\r\nINSERT TABLE
jwesonga wrote:
I've added the line to the script, added a zipped file into the
folder. I've made sure the file exists. The error is now this:
Please get some clues:
(1) Don't reply off-list unless specifically invited.
(2) Don't top-post.
(3) Do read and try to understand *all* of each reply t
On Jun 4, 8:06 pm, jwesonga <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a python script that supposed to go through a folder, pick the
> zipped files, unzip them and process the data inside. I'm not sure
> where i'm going wrong with this script because it all seems correct:
Nothing is ever as it s
Hi,
I have a python script that supposed to go through a folder, pick the
zipped files, unzip them and process the data inside. I'm not sure
where i'm going wrong with this script because it all seems correct:
#! /usr/bin/env python
import zipfile
import os
from elementtree import ElementTree as
On Sat, 19 May 2007 17:00:01 + (UTC), Martin Maney <[EMAIL PROTECTED]>
wrote:
...
> posted here and had so much fun.
Apparently I don't speak for most readers here, but I had fun too.
Smart, reasonable people write braindead code all the time. I think
it's fine when people whine about that o
* Paul Boddie (20 May 2007 08:36:18 -0700)
> Thorsten Kampe wrote:
> > Don't be silly. Where would you look for the URL to report bugs? On
> > the website of the project, of course. It's not that easy to find on
> > python.org (although not as hard as Martin says):
> >
> > Core Development > Links
Thorsten Kampe wrote:
>
> Don't be silly. Where would you look for the URL to report bugs? On
> the website of the project, of course. It's not that easy to find on
> python.org (although not as hard as Martin says):
>
> Core Development > Links for Developers > Bug Manager or
This is the "in crow
* Gabriel Genellina (Sat, 19 May 2007 18:09:06 -0300)
> En Sat, 19 May 2007 14:00:01 -0300, Martin Maney <[EMAIL PROTECTED]>
> escribió:
> > BTW, thanks for the pointer someone else gave to the proper place for
> > posting bugs. I'd had the silly idea that I would be able to find that
> > easily
Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> A module in the Python Standard Library has a bug. I take the Python
> Library Reference manual, go to the last pages (Appendix B), and find how
> to properly report a bug.
Sure, the information is *somewhere*. Silly me, I expected it to be
readi
En Sat, 19 May 2007 14:00:01 -0300, Martin Maney <[EMAIL PROTECTED]>
escribió:
> BTW, thanks for the pointer someone else gave to the proper place for
> posting bugs. I'd had the silly idea that I would be able to find that
> easily at www.python.org, but if I had then I'd not have posted here
Larry Bates <[EMAIL PROTECTED]> bristled:
> Are you serious? A zipfile with a comment > 4Kbytes. I've never encountered
> such a beast.
If I hadn't run into one I would never have had a clue that Python's
zipfile module had this silly bug.
> As with any open so
without saving it into file.
> > > > In the document of the zipfile module, I note that it mentions the
> > > > file-like object? what does it mean?
>
> > > > class ZipFile( file[, mode[, compression[, allowZip64]]])
> > > > Open a ZIP file
ariable. how could I process the
> > > zipfile directly without saving it into file.
> > > In the document of the zipfile module, I note that it mentions the
> > > file-like object? what does it mean?
>
> > > class ZipFile( file[, mode[, compression[, allowZ
hout saving it into file.
> > > > In the document of the zipfile module, I note that it mentions the
> > > > file-like object? what does it mean?
>
> > > > class ZipFile( file[, mode[, compression[, allowZip64]]])
> > > > Open a ZIP file
On Apr 29, 7:37 pm, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote:
> > I made a C/S network program, the client receive the zip file from the
> > server, and read the data into a variable. how could I process the
> > zipfile directly without saving it into file.
rectly without saving it into file.
>>> In the document of the zipfile module, I note that it mentions the
>>> file-like object? what does it mean?
>>> class ZipFile( file[, mode[, compression[, allowZip64]]])
>>> Open a ZIP file, where file can be eith
> > > I made a C/S network program, the client receive the zip file from the
> > > server, and read the data into a variable. how could I process the
> > > zipfile directly without saving it into file.
> > > In the document of the zipfile module, I note that it
On Apr 29, 7:37 pm, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote:
> > I made a C/S network program, the client receive the zip file from the
> > server, and read the data into a variable. how could I process the
> > zipfile directly without saving it into file.
> I made a C/S network program, the client receive the zip file from the
> server, and read the data into a variable. how could I process the
> zipfile directly without saving it into file.
> In the document of the zipfile module, I note that it mentions the
> file-like object? wh
On Apr 29, 9:15 pm, 人言落日是天涯,望极天涯不见家 <[EMAIL PROTECTED]> wrote:
> I made a C/S network program, the client receive the zip file from the
> server, and read the data into a variable. how could I process the
> zipfile directly without saving it into file.
> In the document of the
I made a C/S network program, the client receive the zip file from the
server, and read the data into a variable. how could I process the
zipfile directly without saving it into file.
In the document of the zipfile module, I note that it mentions the
file-like object? what does it mean?
class
Yves Lange wrote:
> Other solutions:
> you can try the rar command line from WinRar but it's not recommended.
> This is a very slow manner to compress file.
Are you sure? This worked about 4 times faster than the zip command line
utility in Linux, compressing the same files...
--
Brian Beck
Adve
Enabling directory recursion:
> from os import listdir, mkdir
> from os.path import join, basename, isfile
> from zipfile import ZipFile
>
> def zip_dir(path, output_path, include_hidden=True):
> try:
> mkdir(output_path)
> except OSError, e:
> if e.errno == 17: # Path exis
Simon Forman a écrit :
> Brian Beck wrote:
>> OriginalBrownster wrote:
>>> I want to zip all the files within a directory called "temp"
>>> and have the zip archive saved in a directory with temp called ziptemp
>>>
>>> I was trying to read
Brian Beck wrote:
> OriginalBrownster wrote:
> > I want to zip all the files within a directory called "temp"
> > and have the zip archive saved in a directory with temp called ziptemp
> >
> > I was trying to read up on how to use the zipfile module python
&g
OriginalBrownster wrote:
> I want to zip all the files within a directory called "temp"
> and have the zip archive saved in a directory with temp called ziptemp
>
> I was trying to read up on how to use the zipfile module python
> provides, but I cannot seem to find
Hi Stephen,
some code that I have been using for a similar purpose.
def
addFolderToZip(myZipFile,folder): folder =
folder.encode('ascii') #convert path to ascii for ZipFile
Method for file in
glob.glob(folder+"/*"):
if
os.path.isfile(file):
print
fil
This will probably sound like a very dumb question.
I am trying to zip some files within a directory.
I want to zip all the files within a directory called "temp"
and have the zip archive saved in a directory with temp called ziptemp
I was trying to read up on how to use the zipf
Ritesh Raj Sarraf wrote:
> The line
> filename = zipfile.ZipFile(zip_file_name, "a")
> throws an exception if the given filename is not present already.
> Shouldn't it create a file (in case one is not there) since it is
> "append" mode ??
Perhaps it would be nicer that way, but it is working as
Hi,
I've got a problem here.
def compress_the_file(zip_file_name, files_to_compress, sSourceDir):
"""
Condenses all the files into one single file for easy transfer
"""
try:
import zipfile
except ImportError:
sys.stderr.write("Ai! module not found.\n")
Hari Sekhon wrote:
> I've seen people using everything from zip to touch, either out of
> laziness or out of the fact it wouldn't work very well in python, this
> zip case is a good example.
so based on a limitation in one library, and some random code you've
seen on the internet, you're makin
Fredrik Lundh wrote:
Hari Sekhon wrote:
I take it that it's still a work in progress to be able to pythonify
everything, and until then we're just gonna have to rely on shell and
those great C coded coreutils and stuff like that. Ok, I'm rather fond
of Bash+coreutils, highest r
Hari Sekhon wrote:
> I take it that it's still a work in progress to be able to pythonify
> everything, and until then we're just gonna have to rely on shell and
> those great C coded coreutils and stuff like that. Ok, I'm rather fond
> of Bash+coreutils, highest ratio of code lines to work I'v
Fredrik Lundh wrote:
Hari Sekhon wrote:
Is it me or is having to use os.system() all the time symtomatic of a
deficiency/things which are missing from python as a language?
it's you.
I take it that it's still a work in progress to be able to pythonify
everything
Hari Sekhon wrote:
> Is it me or is having to use os.system() all the time symtomatic of a
> deficiency/things which are missing from python as a language?
it's you.
--
http://mail.python.org/mailman/listinfo/python-list
On 20/05/06, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
Roger Miller a écrit :> The basic problem is that the zipfile interface only reads and writes> whole files, so it may perform poorly or fail on huge files. At one> time I implemented a patch to allow reading files in chunks. However I
>
Roger Miller a écrit :
> The basic problem is that the zipfile interface only reads and writes
> whole files, so it may perform poorly or fail on huge files. At one
> time I implemented a patch to allow reading files in chunks. However I
> believe that the current interface has too many problems
The basic problem is that the zipfile interface only reads and writes
whole files, so it may perform poorly or fail on huge files. At one
time I implemented a patch to allow reading files in chunks. However I
believe that the current interface has too many problems to solve by
incremental patching,
Sion Arrowsmith wrote:
> Hari Sekhon <[EMAIL PROTECTED]> wrote:
(snip)
>>The python zipfile module is obviously broken...
>
> This isn't at all obvious to me.
zipfile.read() does not seem to take full advantage of zlib's
decompressobj's features. This c
bruno at modulix <[EMAIL PROTECTED]> wrote:
>http://mail.zope.org/pipermail/zope/2004-October/153882.html
>"""
>MemoryError is raised by Python when an underlying (OS-level) allocation
>fails.
>(...)
>Normally this would mean that you were out of even virtual memory
>(swap), but it could also be a
e it. How big is cdimage.zip? How big is the
uncompressed someimage.iso? How much memory do you have?
>The python zipfile module is obviously broken...
This isn't at all obvious to me.
--
\S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/
___ | "Frankly I have no feelin
[EMAIL PROTECTED] wrote:
> Take a look at the pywin32 extension, which I believe has some lower
> level memory allocation and file capabilities that might help you in
> this situation.
But then the solution would not be portable, which would be a shame
since the zlib module (on which ZipFile reli
Take a look at the pywin32 extension, which I believe has some lower
level memory allocation and file capabilities that might help you in
this situation. If I'm completely wrong, someone please tell me XD.
Of course, you could just make the read() a step process, reading, O
lets say 8192 bytes at
x27;)
csize = info.compress_size
fsize = info.file_size
print "someimage compressed size is : %s" % csize
print "someimage real file size is : %s" % fsize
print """
So, knowing how zipfile.read() is actually implemented,
total needed ram is : %s
""&quo
file is huge. Even if it's only a CD image (approx
650MB), reading it all into memory in a single string is not a good idea.
> The python zipfile module is obviously broken...
Indeed. I am surprised that there is no API that returns a file object.
Ganesan
--
Ganesan Rajagopal
--
http://mail.python.org/mailman/listinfo/python-list
both result in the same error:
Traceback (most recent call last):
File "", line 1, in ?
File "D:\u\Python24\lib\zipfile.py", line 357, in read
bytes = dc.decompress(bytes)
MemoryError
I thought python was supposed to handle memory for you?
The python zipfile module i
Hi,I know how to write files to a zip file but i was wondering if there was a way to add a empty folder to the zip file using the zipfile module? I can only write files and not directories to a zip file.Thank You.
--
http://mail.python.org/mailman/listinfo/python-list
I'm using the zipfile module to unpack bundles. Is there a Right way
to recognize directories, or do I just check if the name ends in '/'
(i.e., os.sep)? That is, I have this.
for bundleInfo in bundleObject.infolist():
...stuff...
if bundleInfo.filename[-1:]==os.sep:
Bill Anderson wrote:
> I recently had this issue and discovered that if zlib headers are not
> there, python still builds gzip ... which imports zlib. Seems to me that
> since zlib apparently depends on gzip, gzip should only be built if zlib
> is.
gzip is a Python module, and isn't "built".
if
On Mon, 11 Apr 2005 10:38:37 -0400, Alan Toppen wrote:
> I was unable to use the ZipFile class in the zipfile module in
> Python2.4. I got an error that zlib could not be found. Comparing my
> Python 2.2 installation I noticed Python 2.4 was missing a certain file:
> /usr/lib/p
Alan Toppen wrote:
> When running my Python script it gives a warning:
>
> /usr/local/lib/python2.4/zipfile.py:7: RuntimeWarning: Python C API
version
> mismatch for module zlib: This Python has C API version 1012, module zlib
> has version 1011.
> import zlib # We may need its compression metho
I was unable to use the ZipFile class in the zipfile module in Python2.4. I
got an error that zlib could not be found. Comparing my Python 2.2
installation I noticed Python 2.4 was missing a certain file:
/usr/lib/python2.2/lib-dynload/zlibmodule.so. Unable to find a more elegant
solution, I
53 matches
Mail list logo