Archives and magic bytes

andrea kerny404 at
Thu Mar 24 02:48:52 CET 2005

Hi everybody,
this is my first post but I've read already many of yours interesting 
posts... (sorry for my bad english)

Anyway for my little project I need a module that given an archive (zip, 
bz2, tar ...) gives me back the archive decompressed.

I looked at the modules in the library reference and used some of them, 
but the problem is that they all behave in a different way, and just one 
has a useful command for decompressing files easily, bz2.

    decompress(data) -> decompressed data
    Decompress data in one shot. If you want to decompress data 
    use an instance of BZ2Decompressor instead.
I can't get even that one working, what does it mean data? A file?

Maybe I could implement myself the compression algorithm (or copy that 
from the modules) and implement myself compress/decompress functions, 
what do you think?
Do you know if there is already something similar??

Another thing, I work on linux (gentoo) and I would like to use the 
"file" command to retrieve informations about type of file instead of 
using extensions, do you think this can be done?

Thanks, and sorry if I've done some stupid questions, I'm still a python 
novice (but it's a great language)


More information about the Python-list mailing list