Extending Python dynamically

Robin Dunn robin at alldunn.com
Thu Nov 4 14:35:05 EST 1999


> Thank you for your help. The method you suggested works perfectly!
> However, I do not understand completely how the Python interpreter finds
out
> that it has to load an so file. Normally -- I believed -- when Python sees
an
> "import xxx" statement it looks for a xxx.py, xxx.pyc or xxx.pyo file in
the
> $PYTHONPATH directories or an xxx subdirectory having an __init__.py file,
but
> not an xxx.so file. This means that if I add the current directory to the
> $PYTHONPATH (such as export PYTHONPATH='.' Python will find any arbitrary
so
> file in the $PWD?

It will also load xxxmodule.so as well, but .so files only get imported if
they have an initxxx() function.


--
Robin Dunn
Software Craftsman
robin at AllDunn.com
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!








More information about the Python-list mailing list