zlib.so and libz.so and Python
Skip Montanaro
skip at pobox.com
Thu Feb 14 11:20:51 EST 2002
DeepBleu> Python comes with zlib.so (for Sun OS). But I noticed that on
DeepBleu> the same machine, there is also libz.so. Can someone please
DeepBleu> tell me what is the difference between these two and what
DeepBleu> libz.so is used for?
"zlib" is the name of a Python module. "zlib.so" is the runtime incarnation
of that module. My guess is that libz.so is a shared library version of the
C "zlib" library. The Python module is essentially just a wrapper around
the zlib library. On my linux machine ldd shows that zlib.so depends on
libz.so:
% ldd zlib.so
libz.so.1 => /lib/libz.so.1 (0x40015000)
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x40024000)
libc.so.6 => /lib/libc.so.6 (0x4002c000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
My guess is that you will see something similar on your Solaris system.
DeepBleu> Also, I want to find out if zlib.so (the one that comes with
DeepBleu> the Python distribution) is all we need to work with ZIP files
DeepBleu> in Python.
Technically, I suppose you could, but I think you'll find it a heck of a lot
easier to use the zipfile module (which uses zlib underneath the covers) to
work with ZIP files.
--
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)
More information about the Python-list
mailing list