File Compression

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Oct 2006
Posts: 2,279
Reputation: sneekula has a spectacular aura about sneekula has a spectacular aura about 
Solved Threads: 176
sneekula's Avatar
sneekula sneekula is offline Offline
Nearly a Posting Maven

File Compression

 
0
  #1
Jan 18th, 2007
Since there is so much discussion on one of the threads on zipping/unzipping files and all the associated incompatibilities, is there a way to do this with Python and cut out the middleman?
No one died when Clinton lied.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,028
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 932
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: File Compression

 
0
  #2
Jan 18th, 2007
Python offers a number of modules providing easy file compression and decompression. Here are code snippets for two of the popular compression formats ...
zipfile -->
http://www.daniweb.com/code/snippet629.html
tarfile -->
http://www.daniweb.com/code/snippet630.html
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,279
Reputation: sneekula has a spectacular aura about sneekula has a spectacular aura about 
Solved Threads: 176
sneekula's Avatar
sneekula sneekula is offline Offline
Nearly a Posting Maven

Re: File Compression

 
0
  #3
Jan 21st, 2007
Originally Posted by vegaseat View Post
Python offers a number of modules providing easy file compression and decompression. Here are code snippets for two of the popular compression formats ...
zipfile -->
http://www.daniweb.com/code/snippet629.html
tarfile -->
http://www.daniweb.com/code/snippet630.html
Now that is fairly easy code to work with. I didn't know it was that simple. Does anyone have a particular preference of a compression format?
No one died when Clinton lied.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,279
Reputation: sneekula has a spectacular aura about sneekula has a spectacular aura about 
Solved Threads: 176
sneekula's Avatar
sneekula sneekula is offline Offline
Nearly a Posting Maven

Re: File Compression

 
0
  #4
Jan 21st, 2007
Another question, can zipfile archive several files like tarfile? How would you save the decompresed files?
No one died when Clinton lied.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,028
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 932
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: File Compression

 
0
  #5
Jan 21st, 2007
Originally Posted by sneekula View Post
Another question, can zipfile archive several files like tarfile? How would you save the decompresed files?
An omission on my part, I added another snippet to show you how to pack and unpack files to and from an archived zip file:
http://www.daniweb.com/code/snippet633.html
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC