Using gzip means you can compress only 1 file per gzip; so you'll have
to invent something like tar to put all your files in your directories
together into 1 file and then apply gzip on that file to get it
compressed...
Using the zipfile module should allow you to create a standard
winzip-compatib
Isn't it much easier to figure out how python built-in module 'zipfile'
works?
Pseudo-code would be something like:
#UNTESTED
import zipfile
import os
import os.path
zf = zipfile.ZipFile('myzipfilename.zip', 'w', zipfile.ZIP_DEFLATED)
for root, dirs, files in os.walk('compressthisdir'):
for
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299412
--
http://mail.python.org/mailman/listinfo/python-list
sri2097 wrote:
> Hi all,This is in reply to the 'Compressing folders in Windows using
> Python' query I raised y'day.
>
> I figured out that windows does not allow command line zipping so I
> started looking for alternatives.
>
> I found some modules in Perl which does zipping. I guess it goes by
Hi all,This is in reply to the 'Compressing folders in Windows using
Python' query I raised y'day.
I figured out that windows does not allow command line zipping so I
started looking for alternatives.
I found some modules in Perl which does zipping. I guess it goes by the
name 'gzip'. I plan to w
Christian Tismer wrote:
> sri2097 wrote:
> > Hi,
> > I'm trying to zip a particular fiolder and place the zipped folder into
> > a target folder using python. I have used the following command in
> > 'ubuntu'.
> >
> > zip_command = 'zip -qr %s %s' % (target, ' '.join(source))
> >
> > I execute
sri2097 wrote:
> Hi,
> I'm trying to zip a particular fiolder and place the zipped folder into
> a target folder using python. I have used the following command in
> 'ubuntu'.
>
> zip_command = 'zip -qr %s %s' % (target, ' '.join(source))
>
> I execute this using os.command(zip_command). It w
Heiko Wundram wrote:
> Steven D'Aprano wrote:
>
>>>But when I run this script in Windows XP, I get an error while
>>>executing the above zip command.
>>
>>Would you like to tell us what error you get?
>
>
> I presume the error he's seeing is something along the line of:
>
> "zip: Bad command or
Heiko Wundram wrote:
> That's basically because there is no commandline builtin for zipping up
> files on Windows, and I don't know of WinZIP or any of the InfoZIP derived
> GUIs installing a command-line zipper.
btw. the zip command isn't builtin on Unix either. It's only available if
you install
Steven D'Aprano wrote:
>> But when I run this script in Windows XP, I get an error while
>> executing the above zip command.
>
> Would you like to tell us what error you get?
I presume the error he's seeing is something along the line of:
"zip: Bad command or filename."
That's basically because
On Sun, 01 Jan 2006 04:07:11 -0800, sri2097 wrote:
> Hi,
> I'm trying to zip a particular fiolder and place the zipped folder into
> a target folder using python. I have used the following command in
> 'ubuntu'.
>
> zip_command = 'zip -qr %s %s' % (target, ' '.join(source))
>
> I execute thi
11 matches
Mail list logo