[Pythonmac-SIG] libxml2 on 10.3 (Panther)
Michael Hudson
mwh at python.net
Wed Dec 3 07:45:11 EST 2003
Jack Jansen <Jack.Jansen at cwi.nl> writes:
> On 3 Dec 2003, at 10:42, paul at donovansbrain.co.uk wrote:
>
>> Hi,
>>
>> Despite the fact that 10.3 ships with libxml2, there doesn't appear
>> to be a module to use it with Python 2.3 - 'import libxml2' says
>> that the module doesn't exist.
>>
>> So, how do I get this working? Do I have to recompile libxml2? I'm
>> a bit clueless when it comes to Python modules and the way they
>> relate to other libraries.
>
> Someone actually has to create the module first...
>
> To use an existing C library from Python you need a wrapper module,
> which takes care of converting data representations from Python to C
> and vice versa. This wrapper module is then what you import into
> Python.
>
> Creating a wrapper module is not trivial, but there are some tools
> to help you with it.
For the specific case of libxml2, though, I'm pretty sure someone has
already done it :-)
Cheers,
mwh
--
Just getting something to work usually means writing reams of code
fast, like a Stephen King novel, but making it maintainable and
high-quality code that really expresses the ideas well, is like
writing poetry. Art is taking away. -- Erik Naggum, comp.lang.lisp
More information about the Pythonmac-SIG
mailing list