uncompressed size of .gz file

F

frankabel

Hi!
What python function give me the uncompressed size of .gz file like
"gzip -l name_of_compress_file".
Thank



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

__________________________________________

Aniversario 40 de la CUJAE

Visite:

XII Convencion de Ingenieria y Arquitectura
http://www.cujae.edu.cu/eventos/convencion/
 
C

Cousin Stanley

2004-09-16, (e-mail address removed) ....
Hi!
What python function give me the uncompressed size of .gz file like
"gzip -l name_of_compress_file".
Thank

Frank ....

You might try calling gzip -l
using the os.popen function ....


import os

path_in = '/path/to/some_file.gz'

pipe_in = os.popen( 'gzip -l %s' % path_in )

list_1 = pipe_in.readlines()

list_2 = list_1[ 1 ].split()

c , u , r , n = list_2

print '\n ' , c , u , r , n , '\n'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top