Re: Zipping files/zipfile module

2006-08-02 Thread Brian Beck
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

Re: Zipping files/zipfile module

2006-08-02 Thread Ant
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

Re: Zipping files/zipfile module

2006-08-02 Thread Yves Lange
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 up on how to use the zipfile module python >>> provides, bu

Re: Zipping files/zipfile module

2006-08-02 Thread Simon Forman
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 > > provides, but I cannot seem to find ad

Re: Zipping files/zipfile module

2006-08-01 Thread Brian Beck
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 adequate documentation on funct

Zipping files/zipfile module

2006-08-01 Thread Thomas Thomas
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

Zipping files/zipfile module

2006-08-01 Thread OriginalBrownster
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 zipfile module pytho